input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
test3 ( ) { java . lang . Boolean result = new java_programs . DEPTH_FIRST_SEARCH ( ) . depth_first_search ( nodef , nodee ) ; java . lang . String resultStr = "" ; if ( result ) { resultStr = "Path<sp>found!" ; } else { resultStr = "Path<sp>not<sp>found!" ; } "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( "Path<sp>not<sp>found!" , resultStr ) |
secondMetaElementWithContentTypeContainsCharsetParameter ( ) { java . lang . String html = "<html><head>" + ( ( "<meta<sp>http-equiv=\"Content-Type\"<sp>content=\"text/html\">" + "<meta<sp>http-equiv=\"Content-Type\"<sp>content=\"text/html;<sp>charset=euc-kr\">" ) + "</head><body></body></html>" ) ; org . jsoup . nodes . Document doc = org . jsoup . helper . DataUtil . parseInputStream ( stream ( html , "euc-kr" ) , null , "http://example.com" , org . jsoup . parser . Parser . htmlParser ( ) ) ; "<AssertPlaceHolder>" ; } body ( ) { prepareByteData ( ) ; java . lang . String body ; if ( ( charset ) == null ) body = java . nio . charset . Charset . forName ( DataUtil . defaultCharset ) . decode ( byteData ) . toString ( ) ; else body = java . nio . charset . Charset . forName ( charset ) . decode ( byteData ) . toString ( ) ; ( ( java . nio . Buffer ) ( byteData ) ) . rewind ( ) ; return body ; } | org . junit . Assert . assertEquals ( "" , doc . body ( ) . text ( ) ) |
test26 ( ) { symbolic_examples . symbolic_example_7 . NopolExample ex = new symbolic_examples . symbolic_example_7 . NopolExample ( ) ; "<AssertPlaceHolder>" ; } isPrime ( int ) { if ( a < 0 ) { return false ; } int intermediaire = a % 2 ; if ( intermediaire == 0 ) return false ; int sqrtMiddle = ( ( int ) ( ( java . lang . Math . sqrt ( a ) ) / 2 ) ) ; for ( int i = 3 ; i <= sqrtMiddle ; i += 2 ) { int tmp = a % i ; if ( tmp == 0 ) { return false ; } } return true ; } | org . junit . Assert . assertFalse ( ex . isPrime ( 4 ) ) |
validateSqlScriptInputsValid ( ) { final java . util . List < java . lang . String > validationList = validateSqlScriptInputs ( "1" , io . cloudslang . content . database . utils . MSSQL_DB_TYPE , "username" , "Password" , "someInstance" , "123" , "database" , io . cloudslang . content . database . utils . AUTH_SQL , "Commands" , org . apache . commons . lang3 . StringUtils . EMPTY , "true" , org . apache . commons . lang3 . StringUtils . EMPTY , org . apache . commons . lang3 . StringUtils . EMPTY , io . cloudslang . content . database . utils . TYPE_FORWARD_ONLY , io . cloudslang . content . database . utils . CONCUR_READ_ONLY , org . apache . commons . lang3 . StringUtils . EMPTY ) ; "<AssertPlaceHolder>" ; } validateSqlScriptInputs ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { final java . util . List < java . lang . String > validationList = io . cloudslang . content . database . utils . SQLInputsValidator . validateCommonSqlInputs ( dbServerName , dbType , username , password , instance , dbPort , database , authenticationType , trustAllRoots , trustStore , trustStorePassword , resultSetType , resultSetConcurrency , authLibraryPath ) ; io . cloudslang . content . database . utils . SQLInputsValidator . validateMExclusivityCommands ( sqlCommands , scriptFileName , validationList ) ; return validationList ; } | org . junit . Assert . assertThat ( validationList , org . hamcrest . CoreMatchers . is ( java . util . Collections . < java . lang . String > emptyList ( ) ) ) |
testTryFinally ( ) { org . jboss . additional . testsuite . jdkall . past . eap_6_4_x . management . cli . TryCatchFinallyTestCase . cliOut . reset ( ) ; final org . jboss . as . cli . CommandContext ctx = org . jboss . as . test . integration . management . util . CLITestUtil . getCommandContext ( org . jboss . additional . testsuite . jdkall . past . eap_6_4_x . management . cli . TryCatchFinallyTestCase . cliOut ) ; try { ctx . connectController ( ) ; ctx . handle ( "try" ) ; ctx . handle ( this . getAddPropertyReq ( "try" ) ) ; ctx . handle ( "finally" ) ; ctx . handle ( this . getWritePropertyReq ( "finally" ) ) ; ctx . handle ( "end-try" ) ; org . jboss . additional . testsuite . jdkall . past . eap_6_4_x . management . cli . TryCatchFinallyTestCase . cliOut . reset ( ) ; ctx . handle ( getReadPropertyReq ( ) ) ; "<AssertPlaceHolder>" ; } finally { ctx . handleSafe ( getRemovePropertyReq ( ) ) ; ctx . terminateSession ( ) ; org . jboss . additional . testsuite . jdkall . past . eap_6_4_x . management . cli . TryCatchFinallyTestCase . cliOut . reset ( ) ; } } getValue ( ) { org . jboss . metrics . HATimerService2 . LOGGER . infof ( "%s<sp>is<sp>%s<sp>at<sp>%s" , org . jboss . metrics . HATimerService . class . getSimpleName ( ) , ( started . get ( ) ? "started" : "not<sp>started" ) , java . lang . System . getProperty ( "jboss.node.name" ) ) ; return "" ; } | org . junit . Assert . assertEquals ( "finally" , getValue ( ) ) |
mixedCapacityLimited ( ) { com . iota . iri . network . TransactionRequester txReq = new com . iota . iri . network . TransactionRequester ( com . iota . iri . network . TransactionRequesterTest . tangle , com . iota . iri . network . TransactionRequesterTest . snapshotProvider ) ; int capacity = TransactionRequester . MAX_TX_REQ_QUEUE_SIZE ; for ( int i = 0 ; i < ( capacity * 4 ) ; i ++ ) { com . iota . iri . model . Hash hash = com . iota . iri . TransactionTestUtils . getRandomTransactionHash ( ) ; txReq . requestTransaction ( hash , ( ( i % 2 ) == 1 ) ) ; } "<AssertPlaceHolder>" ; } numberOfTransactionsToRequest ( ) { return ( transactionsToRequest . size ( ) ) + ( milestoneTransactionsToRequest . size ( ) ) ; } | org . junit . Assert . assertEquals ( ( capacity + ( capacity * 2 ) ) , txReq . numberOfTransactionsToRequest ( ) ) |
testGetPropertyPath ( ) { org . talend . components . api . component . PropertyPathConnector pathConnector = new org . talend . components . api . component . PropertyPathConnector ( "foo" , "foo.bar" ) ; "<AssertPlaceHolder>" ; } getPropertyPath ( ) { return propertyPath ; } | org . junit . Assert . assertEquals ( pathConnector . getPropertyPath ( ) , "foo.bar" ) |
nonTrivialTypePutAndGetTest ( ) { final org . nohope . cassandra . mapservice . CMapNonTrivialTypeIT . Dwarf gloin = new org . nohope . cassandra . mapservice . CMapNonTrivialTypeIT . Dwarf ( "Gloin" , "Groin" ) ; final org . nohope . cassandra . mapservice . ValueTuple valueToPut = org . nohope . cassandra . mapservice . ValueTuple . of ( org . nohope . cassandra . mapservice . CMapNonTrivialTypeIT . DWARF_COL , gloin ) ; testMap . put ( new org . nohope . cassandra . mapservice . CPutQuery ( valueToPut ) ) ; final org . nohope . cassandra . mapservice . ValueTuple returnValue = testMap . getOne ( org . nohope . cassandra . mapservice . CMapNonTrivialTypeIT . QUERY ) ; "<AssertPlaceHolder>" ; } get ( int ) { return modules . get ( index ) ; } | org . junit . Assert . assertEquals ( returnValue . get ( org . nohope . cassandra . mapservice . CMapNonTrivialTypeIT . DWARF_COL ) , gloin ) |
synchronizeClusterSchemas_should_not_sync_unshared ( ) { final java . lang . String clusterSchemaName = "ClusterSchema" ; org . pentaho . di . trans . TransMeta transformarion1 = createTransMeta ( ) ; org . pentaho . di . cluster . ClusterSchema clusterSchema1 = org . pentaho . di . ui . spoon . SharedObjectSyncUtilTest . createClusterSchema ( clusterSchemaName , true ) ; transformarion1 . setClusterSchemas ( java . util . Collections . singletonList ( clusterSchema1 ) ) ; spoonDelegates . trans . addTransformation ( transformarion1 ) ; org . pentaho . di . trans . TransMeta transformarion2 = createTransMeta ( ) ; org . pentaho . di . cluster . ClusterSchema clusterSchema2 = org . pentaho . di . ui . spoon . SharedObjectSyncUtilTest . createClusterSchema ( clusterSchemaName , false ) ; transformarion2 . setClusterSchemas ( java . util . Collections . singletonList ( clusterSchema2 ) ) ; spoonDelegates . trans . addTransformation ( transformarion2 ) ; clusterSchema2 . setDynamic ( true ) ; sharedUtil . synchronizeClusterSchemas ( clusterSchema2 ) ; "<AssertPlaceHolder>" ; } isDynamic ( ) { return dynamic ; } | org . junit . Assert . assertThat ( clusterSchema1 . isDynamic ( ) , org . hamcrest . CoreMatchers . equalTo ( false ) ) |
testRemoteAsyncInvocationByValueFromEjbInjcation ( ) { org . jboss . as . test . integration . ejb . remote . async . StatelessRemoteBean . reset ( ) ; java . lang . String [ ] array = new java . lang . String [ ] { "hello" } ; org . jboss . as . test . integration . ejb . remote . async . StatelessRunningBean remote = lookup ( org . jboss . as . test . integration . ejb . remote . async . StatelessRunningBean . class . getSimpleName ( ) , org . jboss . as . test . integration . ejb . remote . async . StatelessRunningBean . class ) ; remote . modifyArray ( array ) ; StatelessRemoteBean . startLatch . countDown ( ) ; if ( ! ( StatelessRemoteBean . doneLatch . await ( 5 , TimeUnit . SECONDS ) ) ) { throw new java . lang . RuntimeException ( "Invocation<sp>was<sp>not<sp>asynchronous" ) ; } "<AssertPlaceHolder>" ; } await ( long , java . util . concurrent . TimeUnit ) { latch . await ( timeout , timeUnit ) ; } | org . junit . Assert . assertEquals ( "hello" , array [ 0 ] ) |
testNewWizardShortCuts ( ) { java . lang . String [ ] newWizardShortcutIds = org . eclipse . ui . PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) . getActivePage ( ) . getNewWizardShortcuts ( ) ; java . lang . String [ ] expectedIds = new java . lang . String [ ] { org . eclipse . corrosion . wizards . newproject . NewCargoProjectWizard . ID , org . eclipse . ui . wizards . newresource . BasicNewFolderResourceWizard . WIZARD_ID , org . eclipse . ui . wizards . newresource . BasicNewFileResourceWizard . WIZARD_ID } ; "<AssertPlaceHolder>" ; } getWorkbench ( ) { return org . eclipse . ui . PlatformUI . getWorkbench ( ) ; } | org . junit . Assert . assertArrayEquals ( expectedIds , newWizardShortcutIds ) |
testGetSetName ( ) { java . lang . String expectedName = "expectedName" ; com . microsoft . windowsazure . services . media . models . ContentKeyInfo contentKeyInfo = new com . microsoft . windowsazure . services . media . models . ContentKeyInfo ( null , new com . microsoft . windowsazure . services . media . implementation . content . ContentKeyRestType ( ) . setName ( expectedName ) ) ; java . lang . String actualName = contentKeyInfo . getName ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( expectedName , actualName ) |
testSingleDirectory1 ( ) { eu . infomas . annotation . FileIterator iter = new eu . infomas . annotation . FileIterator ( new java . io . File ( "./src/test/java/eu/infomas/annotation" ) ) ; "<AssertPlaceHolder>" ; } countFiles ( eu . infomas . annotation . FileIterator ) { int counter = 0 ; while ( ( iter . next ( ) ) != null ) { ++ counter ; } return counter ; } | org . junit . Assert . assertEquals ( 7 , countFiles ( iter ) ) |
testInitCache ( ) { org . apache . abdera . protocol . client . AbderaClient client = new org . apache . abdera . protocol . client . AbderaClient ( ) ; "<AssertPlaceHolder>" ; } getCache ( ) { return cache ; } | org . junit . Assert . assertNotNull ( client . getCache ( ) ) |
testEqualsForEqualPackagesWithVersionRange ( ) { java . lang . String packageName = "package.name" ; java . lang . String version = "[1.0.0,<sp>1.6.3)" ; org . apache . aries . application . modelling . ImportedPackage package1 = instantiatePackage ( packageName , version ) ; org . apache . aries . application . modelling . ImportedPackage package2 = instantiatePackage ( packageName , version ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( package1 , package2 ) |
testGetBlock ( ) { org . inchain . store . BlockStore blockStore = storeProvider . getBlock ( org . inchain . utils . Hex . decode ( "23971206eec0ac170be2a9371867442b15cd422729c5265e3c580c2c51b36ea7" ) ) ; "<AssertPlaceHolder>" ; } decode ( java . lang . String ) { byte [ ] bts = new byte [ ( hexString . length ( ) ) / 2 ] ; for ( int i = 0 ; i < ( bts . length ) ; i ++ ) { bts [ i ] = ( ( byte ) ( java . lang . Integer . parseInt ( hexString . substring ( ( 2 * i ) , ( ( 2 * i ) + 2 ) ) , 16 ) ) ) ; } return bts ; } | org . junit . Assert . assertNotNull ( blockStore ) |
testInjectFinalClass ( ) { final java . lang . String request = "hello" ; final java . lang . String response = "goodBye" ; when ( finalClass . getLocalHostname ( request ) ) . thenReturn ( response ) ; java . lang . String responseMethod = claseConStatic . method1 ( request ) ; System . out . println ( ( "response<sp>=<sp>" + responseMethod ) ) ; "<AssertPlaceHolder>" ; } method1 ( java . lang . String ) { java . lang . String localHostname = finalClass . getLocalHostname ( parametro1 ) ; return localHostname ; } | org . junit . Assert . assertEquals ( responseMethod , response ) |
auth_parse_no_info_2 ( ) { org . apache . jena . rdf . model . Resource r = org . apache . jena . fuseki . main . access . TestAuthorized . model . createResource ( "http://example/none" ) ; org . apache . jena . fuseki . auth . AuthPolicy auth = org . apache . jena . fuseki . build . FusekiBuilder . allowedUsers ( r ) ; "<AssertPlaceHolder>" ; } allowedUsers ( org . apache . jena . fuseki . build . Resource ) { if ( resource == null ) return null ; java . util . Collection < org . apache . jena . fuseki . build . RDFNode > allowedUsers = org . apache . jena . fuseki . build . FusekiBuildLib . getAll ( resource , ( "fu:" + ( pAllowedUsers . getLocalName ( ) ) ) ) ; if ( allowedUsers == null ) return null ; java . util . List < java . lang . String > bad = allowedUsers . stream ( ) . map ( RDFNode :: asNode ) . filter ( ( rn ) -> ! ( org . apache . jena . rdf . model . impl . Util . isSimpleString ( rn ) ) ) . map ( ( rn ) -> rn . toString ( ) ) . collect ( toList ( ) ) ; if ( ! ( bad . isEmpty ( ) ) ) { throw new org . apache . jena . fuseki . FusekiConfigException ( java . lang . String . format ( "User<sp>names<sp>should<sp>be<sp>a<sp>simple<sp>string:<sp>bad<sp>=<sp>%s" , bad ) ) ; } java . util . Collection < java . lang . String > userNames = allowedUsers . stream ( ) . map ( RDFNode :: asNode ) . map ( Node :: getLiteralLexicalForm ) . collect ( toList ( ) ) ; return org . apache . jena . fuseki . auth . Auth . policyAllowSpecific ( userNames ) ; } | org . junit . Assert . assertNull ( auth ) |
testPutCacheItem ( ) { org . codehaus . httpcache4j . HTTPResponse response = new org . codehaus . httpcache4j . HTTPResponse ( org . codehaus . httpcache4j . Status . OK , new org . codehaus . httpcache4j . Headers ( ) ) ; response = storage . insert ( org . codehaus . httpcache4j . cache . CacheStorageAbstractTest . REQUEST , response ) ; response . consume ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return varyHeaders . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , storage . size ( ) ) |
testTruncateToSizeTextSmallerThanMax ( ) { int size = _randomSize ( ) ; java . lang . String text = ( ( com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ( ( size / 2 ) - 1 ) ) ) + ( com . liferay . petra . string . StringPool . SPACE ) ) + ( com . liferay . portal . kernel . test . util . RandomTestUtil . randomString ( ( ( size / 2 ) - 1 ) ) ) ; "<AssertPlaceHolder>" ; } truncateToSize ( java . lang . String , int ) { byte [ ] bytes = content . getBytes ( StandardCharsets . UTF_8 ) ; if ( ( bytes . length ) <= size ) { return content ; } bytes = java . util . Arrays . copyOf ( bytes , size ) ; int i = size - 1 ; while ( ( ( bytes [ i ] ) & 128 ) != 0 ) { i -- ; } if ( i < ( size - 1 ) ) { bytes = java . util . Arrays . copyOf ( bytes , ( i + 1 ) ) ; } return com . liferay . asset . auto . tagger . google . cloud . natural . language . internal . util . GCloudNaturalLanguageUtil . _truncateToWord ( new java . lang . String ( bytes , java . nio . charset . StandardCharsets . UTF_8 ) ) ; } | org . junit . Assert . assertEquals ( text , com . liferay . asset . auto . tagger . google . cloud . natural . language . internal . util . GCloudNaturalLanguageUtil . truncateToSize ( text , size ) ) |
testGetServiceWithSimpleRegistrationTwice ( ) { try ( com . liferay . registry . collections . ServiceTrackerMap < java . lang . String , java . util . List < com . liferay . registry . internal . TrackedOne > > serviceTrackerMap = createServiceTrackerMap ( ) ) { registerService ( new com . liferay . registry . internal . TrackedOne ( ) ) ; registerService ( new com . liferay . registry . internal . TrackedOne ( ) ) ; java . util . List < com . liferay . registry . internal . TrackedOne > services = serviceTrackerMap . getService ( "aTarget" ) ; "<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 ( services . toString ( ) , 2 , services . size ( ) ) |
newInstanceMetadataMirrorReplicationModeOverridesDisabledSnapshots ( ) { when ( tableReplication . getReplicationMode ( ) ) . thenReturn ( ReplicationMode . METADATA_MIRROR ) ; when ( sourceCatalog . isDisableSnapshots ( ) ) . thenReturn ( false ) ; com . hotels . bdp . circustrain . core . source . SourceFactory sourceFactory = new com . hotels . bdp . circustrain . core . source . SourceFactory ( sourceCatalog , sourceHiveConf , sourceMetaStoreClientSupplier , sourceCatalogListener ) ; com . hotels . bdp . circustrain . core . source . Source source = sourceFactory . newInstance ( tableReplication ) ; "<AssertPlaceHolder>" ; } isSnapshotsDisabled ( ) { return snapshotsDisabled ; } | org . junit . Assert . assertTrue ( source . isSnapshotsDisabled ( ) ) |
testSimpleThread ( ) { final xapi . fu . Mutable < java . lang . Boolean > success = new xapi . fu . Mutable ( ) ; java . util . concurrent . Semaphore wait = new java . util . concurrent . Semaphore ( 1 , true ) ; wait . acquire ( ) ; java . util . concurrent . Semaphore finish = new java . util . concurrent . Semaphore ( 1 ) ; finish . acquire ( ) ; java . lang . Thread t = newThreadUnsafe ( ( ) -> { info ( ( "Thread<sp>start<sp>time:<sp>" + ( ( now ( ) ) - ( threadStartTime ( ) ) ) ) ) ; wait . acquire ( ) ; runFinallyUnsafe ( ( ) -> { wait . acquire ( ) ; info ( ( "To<sp>True:<sp>" + ( ( now ( ) ) - ( threadStartTime ( ) ) ) ) ) ; success . set ( true ) ; finish . release ( ) ; } ) ; info ( ( "To<sp>False<sp>2:<sp>" + ( ( now ( ) ) - ( threadStartTime ( ) ) ) ) ) ; success . set ( false ) ; wait . release ( ) ; } ) ; success . set ( false ) ; runFinally ( ( ) -> { info ( ( "To<sp>False<sp>1:<sp>" + ( ( now ( ) ) - ( threadStartTime ( ) ) ) ) ) ; success . set ( false ) ; wait . release ( ) ; } ) ; t . start ( ) ; while ( ( success . out1 ( ) ) != ( Boolean . TRUE ) ) { trySleep ( 100 ) ; flush ( t , 250 ) ; } "<AssertPlaceHolder>" ; } out1 ( ) { return out1Provider ( ) . out1 ( ) ; } | org . junit . Assert . assertTrue ( success . out1 ( ) ) |
testRoundTripConnectionStatusRequest ( ) { final java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; final org . apache . nifi . cluster . protocol . message . NodeConnectionStatusRequestMessage msg = new org . apache . nifi . cluster . protocol . message . NodeConnectionStatusRequestMessage ( ) ; JaxbProtocolUtils . JAXB_CONTEXT . createMarshaller ( ) . marshal ( msg , baos ) ; final java . lang . Object unmarshalled = JaxbProtocolUtils . JAXB_CONTEXT . createUnmarshaller ( ) . unmarshal ( new java . io . ByteArrayInputStream ( baos . toByteArray ( ) ) ) ; "<AssertPlaceHolder>" ; } toByteArray ( ) { final org . apache . nifi . processors . beats . frame . BeatsFrame frame = response . toFrame ( ) ; return encoder . encode ( frame ) ; } | org . junit . Assert . assertTrue ( ( unmarshalled instanceof org . apache . nifi . cluster . protocol . message . NodeConnectionStatusRequestMessage ) ) |
testSetOptionalMatchNoRewrite ( ) { java . lang . String grammar = "grammar<sp>T;\n" + ( ( ( ( "options<sp>{output=AST;}\n" + "a" 1 ) + "ID<sp>:<sp>\'a\'..\'z\'+<sp>;\n" ) + "INT<sp>:<sp>\'0\'..\'9\'+;\n" ) + "a" 0 ) ; java . lang . String treeGrammar = "tree<sp>grammar<sp>TP;\n" + ( "options<sp>{output=AST;<sp>ASTLabelType=CommonTree;<sp>tokenVocab=T;}\n" + "a<sp>:<sp>(ID|INT)?<sp>INT<sp>;\n" ) ; java . lang . String found = execTreeParser ( "a" 6 , grammar , "TParser" , "a" 5 , treeGrammar , "TP" , "a" 2 , "a" , "a" , "a" 3 ) ; "<AssertPlaceHolder>" ; } execTreeParser ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { return execTreeParser ( parserGrammarFileName , parserGrammarStr , parserName , treeParserGrammarFileName , treeParserGrammarStr , treeParserName , lexerName , parserStartRuleName , treeParserStartRuleName , input , false ) ; } | org . junit . Assert . assertEquals ( "a" 4 , found ) |
doTest ( ) { final org . apache . tinkerpop . gremlin . process . traversal . TraversalStrategies strategies = new org . apache . tinkerpop . gremlin . process . traversal . util . DefaultTraversalStrategies ( ) ; strategies . addStrategies ( org . apache . tinkerpop . gremlin . process . traversal . strategy . optimization . EarlyLimitStrategy . instance ( ) ) ; for ( final org . apache . tinkerpop . gremlin . process . traversal . TraversalStrategy strategy : this . otherStrategies ) { strategies . addStrategies ( strategy ) ; if ( strategy instanceof org . apache . tinkerpop . gremlin . process . traversal . strategy . finalization . ProfileStrategy ) { final org . apache . tinkerpop . gremlin . process . traversal . TraversalStrategies os = new org . apache . tinkerpop . gremlin . process . traversal . util . DefaultTraversalStrategies ( ) ; os . addStrategies ( org . apache . tinkerpop . gremlin . process . traversal . strategy . finalization . ProfileStrategy . instance ( ) ) ; this . optimized . asAdmin ( ) . setStrategies ( os ) ; this . optimized . asAdmin ( ) . applyStrategies ( ) ; } } this . original . asAdmin ( ) . setStrategies ( strategies ) ; this . original . asAdmin ( ) . applyStrategies ( ) ; "<AssertPlaceHolder>" ; } applyStrategies ( ) { } | org . junit . Assert . assertEquals ( this . optimized , this . original ) |
testGetDataCategory ( ) { final org . cytoscape . io . DataCategory category = source . getDataCategory ( ) ; "<AssertPlaceHolder>" ; } getDataCategory ( ) { return this . category ; } | org . junit . Assert . assertEquals ( this . category , category ) |
isBillingDataButtonDisabled_FromDateIsNull ( ) { java . util . Date date = new java . util . Date ( java . lang . System . currentTimeMillis ( ) ) ; bean . setFromDate ( null ) ; bean . setToDate ( date ) ; boolean result = bean . isBillingDataButtonDisabled ( ) ; "<AssertPlaceHolder>" ; } isBillingDataButtonDisabled ( ) { java . util . Date date = new java . util . Date ( java . lang . System . currentTimeMillis ( ) ) ; bean . setFromDate ( date ) ; bean . setToDate ( date ) ; boolean result = bean . isBillingDataButtonDisabled ( ) ; org . junit . Assert . assertFalse ( result ) ; } | org . junit . Assert . assertTrue ( result ) |
testMinorCompaction ( ) { org . apache . hadoop . hbase . TableName tn = helper . createTableWithRegions ( 1 ) ; org . apache . hadoop . hbase . quotas . QuotaSettings settings = org . apache . hadoop . hbase . quotas . QuotaSettingsFactory . limitTableSpace ( tn , SpaceQuotaHelperForTests . ONE_GIGABYTE , SpaceViolationPolicy . NO_INSERTS ) ; admin . setQuota ( settings ) ; final long sizePerBatch = 2L * ( SpaceQuotaHelperForTests . ONE_MEGABYTE ) ; final long numBatches = 6 ; for ( long i = 0 ; i < numBatches ; i ++ ) { helper . writeData ( tn , sizePerBatch ) ; admin . flush ( tn ) ; } org . apache . hadoop . hbase . regionserver . HRegion region = org . apache . hbase . thirdparty . com . google . common . collect . Iterables . getOnlyElement ( org . apache . hadoop . hbase . quotas . TestLowLatencySpaceQuotas . TEST_UTIL . getHBaseCluster ( ) . getRegions ( tn ) ) ; long numFiles = getNumHFilesForRegion ( region ) ; "<AssertPlaceHolder>" ; org . apache . hadoop . hbase . quotas . TestLowLatencySpaceQuotas . TEST_UTIL . waitFor ( ( 30 * 1000 ) , 500 , new org . apache . hadoop . hbase . quotas . SpaceQuotaHelperForTests . SpaceQuotaSnapshotPredicate ( conn , tn ) { @ org . apache . hadoop . hbase . quotas . Override boolean evaluate ( org . apache . hadoop . hbase . quotas . SpaceQuotaSnapshot snapshot ) throws org . apache . hadoop . hbase . quotas . Exception { return ( snapshot . getUsage ( ) ) >= ( numFiles * sizePerBatch ) ; } } ) ; org . apache . hadoop . hbase . quotas . TestLowLatencySpaceQuotas . TEST_UTIL . compact ( tn , false ) ; long numFilesAfterMinorCompaction = getNumHFilesForRegion ( region ) ; org . apache . hadoop . hbase . quotas . TestLowLatencySpaceQuotas . TEST_UTIL . waitFor ( ( 30 * 1000 ) , 500 , new org . apache . hadoop . hbase . quotas . SpaceQuotaHelperForTests . SpaceQuotaSnapshotPredicate ( conn , tn ) { @ org . apache . hadoop . hbase . quotas . Override boolean evaluate ( org . apache . hadoop . hbase . quotas . SpaceQuotaSnapshot snapshot ) throws org . apache . hadoop . hbase . quotas . Exception { return ( ( snapshot . getUsage ( ) ) >= ( numFilesAfterMinorCompaction * sizePerBatch ) ) && ( ( snapshot . getUsage ( ) ) <= ( ( numFilesAfterMinorCompaction + 1 ) * sizePerBatch ) ) ; } } ) ; } getNumHFilesForRegion ( org . apache . hadoop . hbase . regionserver . HRegion ) { return region . getStores ( ) . stream ( ) . mapToLong ( ( s ) -> s . getNumHFiles ( ) ) . sum ( ) ; } | org . junit . Assert . assertEquals ( numBatches , numFiles ) |
EsIndexdeleteByQueryException ( ) { com . fujitsu . dc . common . es . EsIndex index = com . fujitsu . dc . common . es . impl . v1_2 . EsRetryTest . esClient . idxAdmin ( "index_for_test" ) ; index . create ( ) ; com . fujitsu . dc . common . es . EsType type = com . fujitsu . dc . common . es . impl . v1_2 . EsRetryTest . esClient . type ( index . getName ( ) , "TypeForTest" , "" , 0 , 0 ) ; "<AssertPlaceHolder>" ; type . create ( "id00001" , new java . util . HashMap < java . lang . Object , java . lang . Object > ( ) ) ; index = createEsIndexInstanceForSuccess ( 3 ) ; com . fujitsu . dc . common . es . query . DcQueryBuilder queryBuilder = com . fujitsu . dc . common . es . query . DcQueryBuilders . matchQuery ( "_id" , "id00001" ) ; index . deleteByQuery ( "index_for_test" , queryBuilder ) ; } getName ( ) { return name ; } | org . junit . Assert . assertNotNull ( type ) |
when_attribute_value_expression_evaluates_to_null_then_evaluateAttribute_should_return_attribute_value ( ) { java . util . Map < java . lang . String , java . lang . Object > attributes = com . google . common . collect . Maps . newTreeMap ( ) ; java . lang . Object value = new java . lang . Object ( ) ; attributes . put ( "value" , value ) ; javax . el . ELContext elContext = facesEnvironment . getElContext ( ) ; javax . el . ValueExpression valueExpression = facesEnvironment . createMock ( javax . el . ValueExpression . class ) ; javax . faces . component . UIComponent component = createMockComponent ( ) ; expect ( facesContext . getELContext ( ) ) . andReturn ( elContext ) ; expect ( component . getValueExpression ( "value" ) ) . andReturn ( valueExpression ) ; expect ( valueExpression . getValue ( elContext ) ) . andReturn ( null ) ; expect ( component . getAttributes ( ) ) . andReturn ( attributes ) ; facesEnvironment . replay ( ) ; java . lang . Object evaluated = org . richfaces . renderkit . RenderKitUtils . evaluateAttribute ( "value" , component , facesContext ) ; "<AssertPlaceHolder>" ; } getAttributes ( ) { return attributesMap ; } | org . junit . Assert . assertEquals ( value , evaluated ) |
saveOrder_shouldFailIfConceptInPreviousOrderDoesNotMatchThatOfTheRevisedOrder ( ) { org . openmrs . Order previousOrder = orderService . getOrder ( 7 ) ; org . openmrs . Order order = previousOrder . cloneForRevision ( ) ; order . setDateActivated ( new java . util . Date ( ) ) ; order . setOrderer ( providerService . getProvider ( 1 ) ) ; order . setEncounter ( encounterService . getEncounter ( 6 ) ) ; org . openmrs . Concept newConcept = conceptService . getConcept ( 5089 ) ; "<AssertPlaceHolder>" ; order . setConcept ( newConcept ) ; expectedException . expect ( org . openmrs . api . EditedOrderDoesNotMatchPreviousException . class ) ; expectedException . expectMessage ( "The<sp>orderable<sp>of<sp>the<sp>previous<sp>order<sp>and<sp>the<sp>new<sp>one<sp>order<sp>don't<sp>match" ) ; orderService . saveOrder ( order , null ) ; } getConcept ( ) { return concept ; } | org . junit . Assert . assertFalse ( previousOrder . getConcept ( ) . equals ( newConcept ) ) |
testLigandBonds ( ) { org . biojava . nbio . structure . Structure s = org . biojava . nbio . structure . StructureIO . getStructure ( "1kh9" ) ; org . biojava . nbio . structure . Atom phosphateP = s . getChain ( "I" ) . getAtomGroup ( 0 ) . getAtom ( "P" ) ; org . biojava . nbio . structure . Atom phosphateO = s . getChain ( "I" ) . getAtomGroup ( 0 ) . getAtom ( "O1" ) ; "<AssertPlaceHolder>" ; } areBonded ( org . biojava . nbio . structure . Atom , org . biojava . nbio . structure . Atom ) { for ( org . biojava . nbio . structure . Bond bond : a . getBonds ( ) ) { if ( ( bond . getOther ( a ) ) == b ) { return true ; } } return false ; } | org . junit . Assert . assertTrue ( areBonded ( phosphateP , phosphateO ) ) |
testCreateBuffer ( ) { io . netty . channel . embedded . EmbeddedChannel channel = org . apache . activemq . artemis . tests . unit . core . remoting . impl . netty . NettyConnectionTest . createChannel ( ) ; org . apache . activemq . artemis . core . remoting . impl . netty . NettyConnection conn = new org . apache . activemq . artemis . core . remoting . impl . netty . NettyConnection ( org . apache . activemq . artemis . tests . unit . core . remoting . impl . netty . NettyConnectionTest . emptyMap , channel , new org . apache . activemq . artemis . tests . unit . core . remoting . impl . netty . NettyConnectionTest . MyListener ( ) , false , false ) ; final int size = 1234 ; org . apache . activemq . artemis . api . core . ActiveMQBuffer buff = conn . createTransportBuffer ( size ) ; buff . writeByte ( ( ( byte ) ( 0 ) ) ) ; "<AssertPlaceHolder>" ; } capacity ( ) { return buffer . capacity ( ) ; } | org . junit . Assert . assertEquals ( size , buff . capacity ( ) ) |
testConvertToRuleActionIn ( ) { org . hawkular . apm . api . model . config . instrumentation . jvm . InstrumentProducer im = new org . hawkular . apm . api . model . config . instrumentation . jvm . InstrumentProducer ( ) ; im . setEndpointTypeExpression ( "\"MyEndpoint\"" ) ; im . setUriExpression ( "\"MyUri\"" ) ; im . setOperationExpression ( "\"MyOperation\"" ) ; org . hawkular . apm . instrumenter . rules . InstrumentProducerTransformer transformer = new org . hawkular . apm . instrumenter . rules . InstrumentProducerTransformer ( ) ; java . lang . String transformed = transformer . convertToRuleAction ( im ) ; java . lang . String expected = ( org . hawkular . apm . instrumenter . rules . InstrumentProducerTransformerTest . ACTION_PREFIX ) + "producerStart(getRuleName(),\"MyUri\",\"MyEndpoint\",\"MyOperation\",null)" ; "<AssertPlaceHolder>" ; } convertToRuleAction ( org . hawkular . apm . api . model . config . instrumentation . jvm . InstrumentAction ) { return "unlink()" ; } | org . junit . Assert . assertEquals ( expected , transformed ) |
testOntvangst ( ) { cleanQueue ( nl . bzk . migratiebrp . voisc . runtime . VOISC_ONTVANGST_QUEUE ) ; sendToMailbox ( "0599010" , "3000200" , "MSG000000001" , null , "BERICHTINHOUD" ) ; final javax . jms . Message message = expectMessage ( nl . bzk . migratiebrp . voisc . runtime . VOISC_ONTVANGST_QUEUE ) ; "<AssertPlaceHolder>" ; } getContent ( javax . jms . Message ) { final java . lang . String content ; if ( message instanceof javax . jms . TextMessage ) { content = ( ( javax . jms . TextMessage ) ( message ) ) . getText ( ) ; } else { throw new java . lang . IllegalArgumentException ( ( "Message<sp>type<sp>niet<sp>ondersteund:<sp>" + ( message . getClass ( ) ) ) ) ; } return content ; } | org . junit . Assert . assertEquals ( "BERICHTINHOUD" , getContent ( message ) ) |
testCompletenessOfSpecifiedInputPortBindings ( ) { org . apache . taverna . scufl2 . api . profiles . ProcessorBinding pb = new org . apache . taverna . scufl2 . api . profiles . ProcessorBinding ( ) ; org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator cv = new org . apache . taverna . scufl2 . validation . correctness . CorrectnessValidator ( ) ; org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener rcvl = new org . apache . taverna . scufl2 . validation . correctness . ReportCorrectnessValidationListener ( ) ; cv . checkCorrectness ( pb , true , rcvl ) ; java . util . Set < org . apache . taverna . scufl2 . validation . correctness . report . NullFieldProblem > nullFieldProblems = rcvl . getNullFieldProblems ( ) ; boolean problem = false ; for ( org . apache . taverna . scufl2 . validation . correctness . report . NullFieldProblem nlp : nullFieldProblems ) { if ( ( nlp . getBean ( ) . equals ( pb ) ) && ( nlp . getFieldName ( ) . equals ( "inputPortBindings" ) ) ) { problem = true ; } } "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return ( getClass ( ) ) == ( obj . getClass ( ) ) ; } | org . junit . Assert . assertFalse ( problem ) |
valueNullTest ( ) { org . marc . everest . datatypes . ANY value = observationHelper ( org . oscarehr . e2e . model . export . template . ResultComponentModelTest . nullLabComponent ) . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertNull ( value ) |
shouldVerifyCode ( ) { java . lang . String totpKey = "ASLO43KDF2J" ; fr . xephi . authme . data . auth . PlayerAuth auth = fr . xephi . authme . data . auth . PlayerAuth . builder ( ) . name ( "Maya" ) . totpKey ( totpKey ) . build ( ) ; java . lang . String inputCode = "408435" ; given ( totpAuthenticator . checkCode ( totpKey , inputCode ) ) . willReturn ( true ) ; boolean result = totpAuthenticator . checkCode ( auth , inputCode ) ; "<AssertPlaceHolder>" ; verify ( googleAuthenticator ) . authorize ( totpKey , 408435 ) ; } checkCode ( java . lang . String , java . lang . String ) { boolean correct = false ; if ( code . equals ( verificationCodes . get ( name . toLowerCase ( ) ) ) ) { verify ( name ) ; correct = true ; } return correct ; } | org . junit . Assert . assertThat ( result , org . hamcrest . Matchers . equalTo ( true ) ) |
testHuidigeSituatieLeeg ( ) { java . util . List < nl . bzk . brp . model . validatie . Melding > meldingen = bral9003 . executeer ( null , null , new nl . bzk . brp . model . attribuuttype . Datum ( 20150101 ) , null ) ; org . mockito . Mockito . verify ( persoonOpschortingHistorieRepository , org . mockito . Mockito . times ( 0 ) ) . haalOpActueleDatumOpschorting ( ( ( nl . bzk . brp . model . objecttype . operationeel . PersoonModel ) ( org . mockito . Matchers . anyObject ( ) ) ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , meldingen . size ( ) ) |
typedObjectFromFloatAndDecimal ( ) { com . pardot . rhombus . cobject . CField field = new com . pardot . rhombus . cobject . CField ( "test" , "decimal" ) ; java . lang . Float jsonValue = 1234.56F ; java . math . BigDecimal expected = java . math . BigDecimal . valueOf ( jsonValue ) ; java . lang . Object result = com . pardot . rhombus . util . JsonUtil . typedObjectFromValueAndField ( jsonValue , field ) ; "<AssertPlaceHolder>" ; } typedObjectFromValueAndField ( java . lang . Object , com . pardot . rhombus . cobject . CField ) { try { return com . pardot . rhombus . util . JsonUtil . typedObjectFromValueAndFieldType ( jsonValue , field . getType ( ) ) ; } catch ( java . lang . IllegalArgumentException e ) { throw new java . lang . IllegalArgumentException ( ( ( ( ( ( ( ( "Field<sp>" + ( field . getName ( ) ) ) + ":<sp>Unable<sp>to<sp>convert<sp>" ) + jsonValue ) + "<sp>of<sp>type<sp>" ) + ( jsonValue . getClass ( ) ) ) + "<sp>to<sp>C*<sp>type<sp>" ) + ( field . getType ( ) . toString ( ) ) ) ) ; } } | org . junit . Assert . assertEquals ( expected , result ) |
testCase32 ( ) { org . evosuite . testcase . DefaultTestCase tc = buildTestCase32 ( ) ; java . util . List < org . evosuite . symbolic . BranchCondition > branch_conditions = executeTest ( tc ) ; "<AssertPlaceHolder>" ; } size ( ) { return theTest . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , branch_conditions . size ( ) ) |
testMoveBelow ( ) { org . eclipse . swt . widgets . Control child1 = new org . eclipse . swt . widgets . Label ( shell , org . eclipse . swt . SWT . NONE ) ; org . eclipse . swt . widgets . Control child2 = new org . eclipse . swt . widgets . Label ( shell , org . eclipse . swt . SWT . NONE ) ; child1 . moveBelow ( child2 ) ; "<AssertPlaceHolder>" ; } getChildren ( ) { return childCollections . toArray ( ) ; } | org . junit . Assert . assertArrayEquals ( new org . eclipse . swt . widgets . Control [ ] { child2 , child1 } , shell . getChildren ( ) ) |
shouldIgnoreClassesWithNoProcedures ( ) { java . util . List < org . neo4j . kernel . api . proc . CallableProcedure > procedures = compile ( org . neo4j . kernel . impl . proc . ReflectiveProcedureTest . PrivateConstructorButNoProcedures . class ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , procedures . size ( ) ) |
testRandShapeAndMinMax ( ) { org . nd4j . linalg . api . ndarray . INDArray ret = org . nd4j . linalg . factory . Nd4j . rand ( new int [ ] { 4 , 2 } , ( - 0.125F ) , 0.125F , org . nd4j . linalg . factory . Nd4j . getRandomFactory ( ) . getNewRandomInstance ( 123 ) ) ; org . nd4j . linalg . api . ndarray . INDArray ret2 = org . nd4j . linalg . factory . Nd4j . rand ( new int [ ] { 4 , 2 } , ( - 0.125F ) , 0.125F , org . nd4j . linalg . factory . Nd4j . getRandomFactory ( ) . getNewRandomInstance ( 123 ) ) ; "<AssertPlaceHolder>" ; } getNewRandomInstance ( long ) { try { org . nd4j . linalg . api . rng . Random t = ( ( org . nd4j . linalg . api . rng . Random ) ( randomClass . newInstance ( ) ) ) ; if ( ( t . getStatePointer ( ) ) != null ) { } t . setSeed ( seed ) ; return t ; } catch ( java . lang . Exception e ) { throw new java . lang . RuntimeException ( e ) ; } } | org . junit . Assert . assertEquals ( ret , ret2 ) |
testFormat ( ) { testFormatting ( org . esa . beam . util . converters . JtsGeometryConverterTest . factory . createPoint ( new com . vividsolutions . jts . geom . Coordinate ( 12.456789 , 1.0E-8 ) ) ) ; final com . vividsolutions . jts . geom . Coordinate [ ] coordinates = new com . vividsolutions . jts . geom . Coordinate [ ] { new com . vividsolutions . jts . geom . Coordinate ( 2 , 0 ) , new com . vividsolutions . jts . geom . Coordinate ( 6 , 0 ) , new com . vividsolutions . jts . geom . Coordinate ( 8 , 3 ) , new com . vividsolutions . jts . geom . Coordinate ( 8 , 9 ) , new com . vividsolutions . jts . geom . Coordinate ( 6 , 11 ) , new com . vividsolutions . jts . geom . Coordinate ( 2 , 9 ) , new com . vividsolutions . jts . geom . Coordinate ( 2 , 0 ) } ; final com . vividsolutions . jts . geom . LinearRing linearRing = org . esa . beam . util . converters . JtsGeometryConverterTest . factory . createLinearRing ( coordinates ) ; testFormatting ( linearRing ) ; final com . vividsolutions . jts . geom . Coordinate [ ] hole = new com . vividsolutions . jts . geom . Coordinate [ ] { new com . vividsolutions . jts . geom . Coordinate ( 4 , 4 ) , new com . vividsolutions . jts . geom . Coordinate ( 5 , 4 ) , new com . vividsolutions . jts . geom . Coordinate ( 5 , 6 ) , new com . vividsolutions . jts . geom . Coordinate ( 4 , 6 ) , new com . vividsolutions . jts . geom . Coordinate ( 4 , 4 ) } ; final com . vividsolutions . jts . geom . Polygon polygon = org . esa . beam . util . converters . JtsGeometryConverterTest . factory . createPolygon ( linearRing , new com . vividsolutions . jts . geom . LinearRing [ ] { org . esa . beam . util . converters . JtsGeometryConverterTest . factory . createLinearRing ( hole ) } ) ; testFormatting ( polygon ) ; "<AssertPlaceHolder>" ; } format ( com . vividsolutions . jts . geom . Geometry ) { if ( value == null ) { return "" ; } return new com . vividsolutions . jts . io . WKTWriter ( ) . write ( value ) ; } | org . junit . Assert . assertEquals ( "" , org . esa . beam . util . converters . JtsGeometryConverterTest . converter . format ( null ) ) |
isLastUpTo ( ) { int level = 3 ; "<AssertPlaceHolder>" ; historySplit [ 2 ] . isLastUpTo ( level ) ; } | org . junit . Assert . assertTrue ( ( ( historySplit [ 2 ] . size ( ) ) == 2 ) ) |
replaceInTemplatePartWeShouldGetRightString ( ) { java . lang . String template = "Hello,<sp>${name},<sp>How<sp>are<sp>you<sp>${subject}" ; ru . szhernovoy . generator . Template templ = new ru . szhernovoy . generator . SimpleGenerator ( ) ; java . util . Map < java . lang . String , java . lang . String > map = new java . util . HashMap ( ) ; map . put ( "name" , "Sergey" ) ; map . put ( "subject" , "my<sp>friend" ) ; java . lang . String result = null ; try { result = templ . generate ( template , map ) ; } catch ( ru . szhernovoy . generator . KeyException kexc ) { kexc . printStackTrace ( ) ; result = "Hello,<sp>Sergey,<sp>How<sp>are<sp>you<sp>my<sp>friend" ; } System . out . println ( result ) ; java . lang . String check = "Hello,<sp>Sergey,<sp>How<sp>are<sp>you<sp>my<sp>friend" ; "<AssertPlaceHolder>" ; } println ( java . lang . Object ) { this . out . append ( value ) . append ( "\n" ) ; } | org . junit . Assert . assertThat ( check , org . hamcrest . core . Is . is ( result ) ) |
getWhenReEnableBySystemStringGivenDefaultsThenReturnsEmptyString ( ) { final com . nirima . jenkins . plugins . docker . DockerDisabledTest . TestClass i = new com . nirima . jenkins . plugins . docker . DockerDisabledTest . TestClass ( ) ; final java . lang . String actual = i . getWhenReEnableBySystemString ( ) ; "<AssertPlaceHolder>" ; } getWhenReEnableBySystemString ( ) { final long now = readTimeNowInNanoseconds ( ) ; if ( ! ( getDisabledBySystem ( ) ) ) { return "" ; } final long howSoonInNanoseconds = ( nanotimeWhenReEnableBySystem ) - now ; final long howSoonInMilliseconds = TimeUnit . NANOSECONDS . toMillis ( howSoonInNanoseconds ) ; return hudson . Util . getTimeSpanString ( howSoonInMilliseconds ) ; } | org . junit . Assert . assertEquals ( "" , actual ) |
testCleanDatabase ( ) { java . util . List < org . nhindirect . config . store . Domain > domains = domainDao . searchDomain ( null , null ) ; if ( domains != null ) for ( org . nhindirect . config . store . Domain dom : domains ) domainDao . delete ( dom . getDomainName ( ) ) ; domains = domainDao . searchDomain ( null , null ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 0 , domains . size ( ) ) |
twoConstructorsNoCharlieNoDelta ( ) { org . springframework . issues . Alpha alpha = createAndRefreshApplicationContext ( "two-constructors" ) ; "<AssertPlaceHolder>" ; } getBravo ( ) { return bravo ; } | org . junit . Assert . assertNotNull ( alpha . getBravo ( ) ) |
testPortCreationInProducer ( ) { checkPortsCreator ( new eu . dnetlib . iis . common . java . jsonworkflownodes . PortsCreator ( ) { @ eu . dnetlib . iis . common . java . jsonworkflownodes . Override public java . util . Map < java . lang . String , eu . dnetlib . iis . common . java . porttype . PortType > getPorts ( java . lang . String [ ] specificationStrings ) { eu . dnetlib . iis . common . java . jsonworkflownodes . Producer producer = new eu . dnetlib . iis . common . java . jsonworkflownodes . Producer ( specificationStrings ) ; "<AssertPlaceHolder>" ; return producer . getOutputPorts ( ) ; } } ) ; } getInputPorts ( ) { return new java . util . HashMap < java . lang . String , eu . dnetlib . iis . common . java . porttype . PortType > ( ) ; } | org . junit . Assert . assertEquals ( 0 , producer . getInputPorts ( ) . size ( ) ) |
stateMachineTraits060Test ( ) { cruise . umple . compiler . UmpleModel model = getModelByFilename ( "trait_test_data_0018.ump" ) ; boolean result = false ; try { model . run ( ) ; } catch ( java . lang . Exception e ) { result = e . getMessage ( ) . contains ( "236" ) ; } 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 ) |
test_Filter10 ( ) { java . lang . String expected = "cbabc" ; java . lang . String actual ; org . osgi . framework . Bundle bundle = installBundle ( org . eclipse . equinox . http . servlet . tests . TEST_BUNDLE_1 ) ; try { bundle . start ( ) ; actual = requestAdvisor . request ( "TestFilter10/cbabc" ) ; } finally { uninstallBundle ( bundle ) ; } "<AssertPlaceHolder>" ; } uninstallBundle ( org . osgi . framework . Bundle ) { org . eclipse . equinox . internal . security . tests . storage . WaitingRegistryListener listener = new org . eclipse . equinox . internal . security . tests . storage . WaitingRegistryListener ( ) ; listener . register ( "org.eclipse.equinox.security.secureStorage" ) ; try { bundle . uninstall ( ) ; bundle = null ; org . junit . Assert . assertTrue ( ( ( listener . waitFor ( 1 , ( 10 * ( org . eclipse . equinox . internal . security . tests . storage . DynamicPreferencesTest . MAX_TIME_PER_BUNDLE ) ) ) ) == 1 ) ) ; return true ; } finally { listener . unregister ( ) ; if ( bundle != null ) bundle . uninstall ( ) ; } } | org . junit . Assert . assertEquals ( expected , actual ) |
testLargeGroupListNodeWithoutTableSize ( ) { java . lang . String scratchpadSchemaName = "oldSchema" 1 ; org . verdictdb . core . querying . TempIdCreatorInScratchpadSchema idCreator = new org . verdictdb . core . querying . TempIdCreatorInScratchpadSchema ( scratchpadSchemaName ) ; java . lang . String schemaName = "oldSchema" ; java . lang . String tableName = "oldTable" ; java . lang . String primaryColumnName = "pcolumn" ; long blockSize = 10 ; org . verdictdb . core . scrambling . LargeGroupListNode node = new org . verdictdb . core . scrambling . LargeGroupListNode ( idCreator , schemaName , tableName , primaryColumnName , blockSize ) ; org . verdictdb . core . sqlobject . SqlConvertible sqlobj = node . createQuery ( java . util . Arrays . < org . verdictdb . core . execplan . ExecutionInfoToken > asList ( ) ) ; java . lang . String sql = org . verdictdb . sqlwriter . QueryToSql . convert ( new org . verdictdb . sqlsyntax . HiveSyntax ( ) , sqlobj ) ; java . lang . String actual = sql . replaceAll ( "verdictdbtemptable_\\d+_\\d+" , "verdictdbtemptable" ) ; java . lang . String expected = "create<sp>table<sp>`verdictdbtempSchema`.`verdictdbtemptable`<sp>stored<sp>as<sp>parquet<sp>" + ( ( ( ( "as<sp>select<sp>t.`pcolumn`<sp>as<sp>`verdictdbrenameprimarygroup`,<sp>" + "count(*)<sp>*<sp>(1.0<sp>/<sp>0.001)<sp>as<sp>`groupSize`<sp>" ) + "oldSchema" 0 ) + "where<sp>rand()<sp><<sp>0.001<sp>" ) + "group<sp>by<sp>`pcolumn`" ) ; "<AssertPlaceHolder>" ; } convert ( org . verdictdb . sqlsyntax . SqlSyntax , org . verdictdb . core . sqlobject . SqlConvertible ) { if ( query == null ) { throw new org . verdictdb . exception . VerdictDBValueException ( "null<sp>value<sp>passed" ) ; } if ( query instanceof org . verdictdb . core . sqlobject . SelectQuery ) { org . verdictdb . sqlwriter . SelectQueryToSql tosql = new org . verdictdb . sqlwriter . SelectQueryToSql ( syntax ) ; return tosql . toSql ( ( ( org . verdictdb . core . sqlobject . SelectQuery ) ( query ) ) ) ; } else if ( query instanceof org . verdictdb . core . sqlobject . CreateSchemaQuery ) { org . verdictdb . sqlwriter . CreateSchemaToSql tosql = new org . verdictdb . sqlwriter . CreateSchemaToSql ( syntax ) ; return tosql . toSql ( ( ( org . verdictdb . core . sqlobject . CreateSchemaQuery ) ( query ) ) ) ; } else if ( query instanceof org . verdictdb . core . sqlobject . CreateTableQuery ) { org . verdictdb . sqlwriter . CreateTableToSql tosql = new org . verdictdb . sqlwriter . CreateTableToSql ( syntax ) ; return tosql . toSql ( ( ( org . verdictdb . core . sqlobject . CreateTableQuery ) ( query ) ) ) ; } else if ( query instanceof org . verdictdb . core . sqlobject . DropTableQuery ) { org . verdictdb . sqlwriter . DropTableToSql tosql = new org . verdictdb . sqlwriter . DropTableToSql ( syntax ) ; return tosql . toSql ( ( ( org . verdictdb . core . sqlobject . DropTableQuery ) ( query ) ) ) ; } else if ( query instanceof org . verdictdb . core . sqlobject . InsertValuesQuery ) { org . verdictdb . sqlwriter . InsertQueryToSql tosql = new org . verdictdb . sqlwriter . InsertQueryToSql ( syntax ) ; return tosql . toSql ( ( ( org . verdictdb . core . sqlobject . InsertValuesQuery ) ( query ) ) ) ; } else if ( query instanceof org . verdictdb . core . sqlobject . InsertIntoSelectQuery ) { org . verdictdb . sqlwriter . InsertQueryToSql tosql = new org . verdictdb . sqlwriter . InsertQueryToSql ( syntax ) ; return tosql . toSql ( ( ( org . verdictdb . core . sqlobject . InsertIntoSelectQuery ) ( query ) ) ) ; } else if ( query instanceof org . verdictdb . core . sqlobject . SetOperationRelation ) { org . verdictdb . sqlwriter . SetOperationToSql tosql = new org . verdictdb . sqlwriter . SetOperationToSql ( syntax ) ; return tosql . toSql ( ( ( org . verdictdb . core . sqlobject . SetOperationRelation ) ( query ) ) ) ; } else { throw new org . verdictdb . exception . VerdictDBTypeException ( query ) ; } } | org . junit . Assert . assertEquals ( expected , actual ) |
testOnPostbackDefaultsToTrue ( ) { com . ocpsoft . pretty . faces . config . mapping . UrlMapping mapping = config . getMappingById ( "0" ) ; "<AssertPlaceHolder>" ; } isOnPostback ( ) { return onPostback ; } | org . junit . Assert . assertEquals ( true , mapping . isOnPostback ( ) ) |
testFindByPrimaryKeyExisting ( ) { com . liferay . portal . kernel . model . Company newCompany = addCompany ( ) ; com . liferay . portal . kernel . model . Company existingCompany = _persistence . findByPrimaryKey ( newCompany . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingCompany , newCompany ) |
zipPlusFiveParses ( ) { java . util . List < java . util . List < java . lang . String > > pages = gov . nysenate . openleg . processor . hearing . PublicHearingTestHelper . getPagesFromFileName ( "09-17-13<sp>Carlucci_Mental<sp>Health_Ogdensburg_FINAL.txt" ) ; java . lang . String expected = "Ogdensburg<sp>City<sp>Hall\nCity<sp>Council<sp>Chambers\n330<sp>Ford<sp>Street\nOgdensburg,<sp>New<sp>York<sp>13669-1626" ; java . lang . String actual = addressParser . parse ( pages . get ( 0 ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Object ) { if ( ( gov . nysenate . openleg . service . shiro . shiroCacheManager . cache . get ( key ) ) == null ) return null ; else return gov . nysenate . openleg . service . shiro . shiroCacheManager . cache . get ( key ) . getObjectValue ( ) ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . is ( expected ) ) |
testBuildSoqlQueryComplexRelationship ( ) { java . lang . String expected = "\"SELECT<sp>Id,<sp>Name,<sp>(SELECT<sp>Quantity,<sp>ListPrice,<sp>PricebookEntry.UnitPrice,<sp>PricebookEntry.Name<sp>FROM<sp>OpportunityLineItems)<sp>FROM<sp>Opportunity\"" ; org . apache . avro . Schema schema = org . apache . avro . SchemaBuilder . record ( "Result" ) . fields ( ) . name ( "Id" ) . type ( ) . stringType ( ) . noDefault ( ) . name ( "Name" ) . type ( ) . stringType ( ) . noDefault ( ) . name ( "OpportunityLineItems_records_Quantity" ) . type ( ) . stringType ( ) . noDefault ( ) . name ( "OpportunityLineItems_records_ListPrice" ) . type ( ) . stringType ( ) . noDefault ( ) . name ( "OpportunityLineItems_records_PricebookEntry_UnitPrice" ) . type ( ) . stringType ( ) . noDefault ( ) . name ( "OpportunityLineItems_records_PricebookEntry_Name" ) . type ( ) . stringType ( ) . noDefault ( ) . endRecord ( ) ; java . lang . String queryFromBuilder = new org . talend . components . salesforce . soql . SoqlQueryBuilder ( schema , "Opportunity" ) . buildSoqlQuery ( ) ; "<AssertPlaceHolder>" ; } buildSoqlQuery ( ) { java . lang . StringBuilder resultQuery = new java . lang . StringBuilder ( ) ; java . util . List < java . lang . String > complexFields = new java . util . ArrayList ( ) ; int childPosition = 0 ; resultQuery . append ( org . talend . components . salesforce . soql . SoqlQueryBuilder . DOUBLE_QUOTE ) . append ( org . talend . components . salesforce . soql . SoqlQueryBuilder . SELECT_STATEMENT ) . append ( org . talend . components . salesforce . soql . SoqlQueryBuilder . SPACE_SEPARATOR ) ; for ( org . apache . avro . Schema . Field field : schema . getFields ( ) ) { java . lang . String fieldName = field . name ( ) ; if ( isChildField ( fieldName ) ) { if ( 0 == childPosition ) { childPosition = resultQuery . length ( ) ; } complexFields . add ( fieldName ) ; } else if ( org . talend . components . salesforce . soql . SoqlQueryBuilder . PATTERN . matcher ( fieldName ) . matches ( ) ) { resultQuery . append ( splitParentCustomField ( fieldName ) ) . append ( org . talend . components . salesforce . soql . SoqlQueryBuilder . COMMA_AND_SPACE ) ; } else if ( ( fieldName . contains ( org . talend . components . salesforce . soql . SoqlQueryBuilder . UNDERSCORE ) ) && ( ! ( isCustomValues ( fieldName ) ) ) ) { resultQuery . append ( fieldName . replace ( '_' , '.' ) ) . append ( org . talend . components . salesforce . soql . SoqlQueryBuilder . COMMA_AND_SPACE ) ; } else { resultQuery . append ( fieldName ) . append ( org . talend . components . salesforce . soql . SoqlQueryBuilder . COMMA_AND_SPACE ) ; } } if ( ! ( complexFields . isEmpty ( ) ) ) { resultQuery . insert ( childPosition , buildSubquery ( complexFields ) . append ( org . talend . components . salesforce . soql . SoqlQueryBuilder . COMMA_AND_SPACE ) ) ; } resultQuery . delete ( ( ( resultQuery . length ( ) ) - 2 ) , resultQuery . length ( ) ) ; resultQuery . append ( org . talend . components . salesforce . soql . SoqlQueryBuilder . FROM_CLAUSE ) . append ( entityName ) . append ( org . talend . components . salesforce . soql . SoqlQueryBuilder . DOUBLE_QUOTE ) ; return resultQuery . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , queryFromBuilder ) |
testProbabilitySamplerSink ( ) { System . out . println ( "Probability<sp>sampler" ) ; long historyLen = 300 ; com . cloudera . flume . reporter . history . ScheduledHistoryReporter < com . cloudera . flume . reporter . aggregator . CounterSink > hist = new com . cloudera . flume . reporter . history . ScheduledHistoryReporter < com . cloudera . flume . reporter . aggregator . CounterSink > ( "test" , com . cloudera . flume . reporter . sampler . TestSamplers . longwait , historyLen , new com . cloudera . flume . reporter . history . DumbTagger ( ) ) { @ com . cloudera . flume . reporter . sampler . Override public com . cloudera . flume . reporter . aggregator . CounterSink newSink ( com . cloudera . flume . handlers . rolling . Tagger format ) throws java . io . IOException { com . cloudera . flume . reporter . aggregator . CounterSink count = new com . cloudera . flume . reporter . aggregator . CounterSink ( "count" ) { public void append ( com . cloudera . flume . core . Event e ) throws com . cloudera . flume . reporter . sampler . InterruptedException , java . io . IOException { super . append ( e ) ; System . out . println ( e ) ; } } ; return count ; } @ com . cloudera . flume . reporter . sampler . Override public com . cloudera . flume . reporter . ReportEvent getMetrics ( ) { return null ; } @ com . cloudera . flume . reporter . sampler . Override public void getReports ( java . lang . String namePrefix , java . util . Map < java . lang . String , com . cloudera . flume . reporter . ReportEvent > reports ) { reports . put ( ( namePrefix + ( getName ( ) ) ) , getMetrics ( ) ) ; } } ; com . cloudera . flume . reporter . sampler . ProbabilitySampler < com . cloudera . flume . reporter . history . ScheduledHistoryReporter < com . cloudera . flume . reporter . aggregator . CounterSink > > sample = new com . cloudera . flume . reporter . sampler . ProbabilitySampler < com . cloudera . flume . reporter . history . ScheduledHistoryReporter < com . cloudera . flume . reporter . aggregator . CounterSink > > ( hist , 0.1 , 1337 ) ; sample . open ( ) ; int [ ] events = new int [ ] { 15 , 4 , 234 , 20 } ; for ( int i = 0 ; i < ( events . length ) ; i ++ ) { for ( int j = 0 ; j < ( events [ i ] ) ; j ++ ) { java . lang . String s = ( ( "test<sp>" + i ) + "," ) + j ; sample . append ( new com . cloudera . flume . core . EventImpl ( s . getBytes ( ) ) ) ; } hist . forcedRotate ( ) ; } int [ ] ans = new int [ ] { 1 , 0 , 20 , 4 } ; java . util . List < com . cloudera . util . Pair < java . lang . Long , com . cloudera . flume . reporter . aggregator . CounterSink > > h = hist . getHistory ( ) ; int i = 0 ; for ( com . cloudera . util . Pair < java . lang . Long , com . cloudera . flume . reporter . aggregator . CounterSink > p : h ) { long count = p . getRight ( ) . getCount ( ) ; System . out . println ( ( ( ( p . getLeft ( ) ) + "<sp>::<sp>" ) + count ) ) ; "<AssertPlaceHolder>" ; i ++ ; } } getLeft ( ) { return left ; } | org . junit . Assert . assertEquals ( ans [ i ] , count ) |
test ( ) { org . zkoss . zats . mimic . DesktopAgent desktop = connect ( ) ; desktop . query ( "#addPersonBtn" ) . click ( ) ; desktop . query ( "#delPerson_0" ) . click ( ) ; desktop . query ( "#addUrlBtn" ) . click ( ) ; desktop . query ( "#delUrl_0" ) . click ( ) ; org . zkoss . zats . mimic . ComponentAgent widget = desktop . query ( "#delUrl_0" ) ; "<AssertPlaceHolder>" ; } query ( java . lang . String ) { final java . util . Iterator < org . zkoss . zk . ui . Component > found = org . zkoss . zk . ui . select . Selectors . iterable ( this , selector ) . iterator ( ) ; return found . hasNext ( ) ? found . next ( ) : null ; } | org . junit . Assert . assertFalse ( ( widget != null ) ) |
testWarmup ( ) { debug = false ; java . io . InputStream inputStream = runAndRenderReport ( "MegaSize.rptdesign" , "xlsx" ) ; "<AssertPlaceHolder>" ; try { } finally { inputStream . close ( ) ; } } runAndRenderReport ( java . lang . String , java . lang . String ) { return runAndRenderReportCustomTask ( filename , outputFormat ) ; } | org . junit . Assert . assertNotNull ( inputStream ) |
testSecuredOrgUnitsWithPermission ( ) { when ( authorizationManager . authorize ( any ( org . uberfire . security . Resource . class ) , any ( org . jboss . errai . security . shared . api . identity . User . class ) ) ) . thenReturn ( true ) ; java . util . Collection < org . guvnor . structure . organizationalunit . OrganizationalUnit > orgUnits = organizationalUnitService . getOrganizationalUnits ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return fileAttrs . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , orgUnits . size ( ) ) |
getIndexOfCommandParameter ( ) { retryCommandSpy . originalArgs = java . util . Arrays . asList ( "retry" , "-d" , "tmp" , "--command" ) ; "<AssertPlaceHolder>" ; } getIndexOfCommandParameter ( ) { int indexOf = originalArgs . indexOf ( com . box . l10n . mojito . cli . command . RetryCommand . COMMAND_SHORT ) ; if ( indexOf == ( - 1 ) ) { indexOf = originalArgs . indexOf ( com . box . l10n . mojito . cli . command . RetryCommand . COMMAND_LONG ) ; } return indexOf ; } | org . junit . Assert . assertEquals ( 3 , retryCommandSpy . getIndexOfCommandParameter ( ) ) |
testDurationIsPositivValue ( ) { io . github . tcdl . msb . config . MsbConfig msbConf = new io . github . tcdl . msb . config . MsbConfig ( com . typesafe . config . ConfigFactory . load ( ) ) ; io . github . tcdl . msb . api . message . MetaMessage metaMessage = new io . github . tcdl . msb . api . message . MetaMessage . Builder ( 0 , clock . instant ( ) . minusMillis ( 1 ) , msbConf . getServiceDetails ( ) , clock ) . build ( ) ; "<AssertPlaceHolder>" ; } getDurationMs ( ) { return durationMs ; } | org . junit . Assert . assertTrue ( ( ( metaMessage . getDurationMs ( ) ) > 0 ) ) |
testMaximumTimeMillisecondsDefault ( ) { final com . allanbank . mongodb . bson . Document query = Find . ALL ; final com . allanbank . mongodb . bson . Document update = com . allanbank . mongodb . bson . builder . BuilderFactory . start ( ) . addInteger ( "foo" , 3 ) . build ( ) ; final com . allanbank . mongodb . builder . FindAndModify . Builder b = com . allanbank . mongodb . builder . FindAndModify . builder ( ) ; b . setQuery ( query ) ; b . setUpdate ( update ) ; final com . allanbank . mongodb . builder . FindAndModify command = b . build ( ) ; "<AssertPlaceHolder>" ; } getMaximumTimeMilliseconds ( ) { return myMaximumTimeMilliseconds ; } | org . junit . Assert . assertThat ( command . getMaximumTimeMilliseconds ( ) , org . hamcrest . Matchers . is ( 0L ) ) |
search_match_partial_email_address ( ) { databaseHelper . addObject ( net . ripe . db . whois . common . rpsl . RpslObject . parse ( ( "mntner:<sp>OWNER-MNT\n" + "source:<sp>RIPE" ) ) ) ; databaseHelper . addObject ( net . ripe . db . whois . common . rpsl . RpslObject . parse ( ( "organisation:<sp>ORG-TOS1-TEST\n" + ( ( ( ( ( ( ( "org-name:<sp>ORG-TOS1-TEST\n" + "org-type:<sp>OTHER\n" ) + "org-name:<sp>ORG-TOS1-TEST\n" 1 ) + "address:<sp>street<sp>1\n" ) + "e-mail:<sp>org1@test.com\n" ) + "mnt-ref:<sp>OWNER-MNT\n" ) + "mnt-by:<sp>OWNER-MNT\n" ) + "source:<sp>RIPE\n" ) ) ) ) ; fullTextIndex . rebuild ( ) ; "<AssertPlaceHolder>" ; } numFound ( org . apache . solr . client . solrj . response . QueryResponse ) { return queryResponse . getResults ( ) . getNumFound ( ) ; } | org . junit . Assert . assertThat ( numFound ( query ( "org-name:<sp>ORG-TOS1-TEST\n" 0 ) ) , org . hamcrest . Matchers . is ( 1L ) ) |
constructorSavesPropertyName ( ) { final java . lang . String name = "test-name" ; final java . lang . String value = "test-value" ; com . microsoft . azure . sdk . iot . device . MessageProperty property = new com . microsoft . azure . sdk . iot . device . MessageProperty ( name , value ) ; java . lang . String testName = property . getName ( ) ; final java . lang . String expectedName = name ; "<AssertPlaceHolder>" ; } getName ( ) { return "filenotificationreceiver" ; } | org . junit . Assert . assertThat ( testName , org . hamcrest . CoreMatchers . is ( expectedName ) ) |
getInstanceDetails_withException ( ) { org . oscm . app . common . instanceDetail . ExtensionInterfaceBean bean = getTestBean ( instanceID , subscriptionID , organizationID ) ; org . mockito . Mockito . < java . util . List < ? extends org . oscm . app . v2_0 . intf . ServerInformation > > when ( instanceAccess . getServerDetails ( instanceID , subscriptionID , organizationID ) ) . thenThrow ( new org . oscm . app . v2_0 . exceptions . APPlatformException ( "Error!!" ) ) ; java . util . List < ? extends org . oscm . app . v2_0 . intf . ServerInformation > sv = bean . getInstanceDetails ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return categoriesForMarketplace . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , sv . size ( ) ) |
testQueryByDeploymentId ( ) { java . lang . String deploymentId = repositoryService . createDeployment ( ) . addClasspathResource ( org . camunda . bpm . engine . test . standalone . history . CustomHistoryLevelWithoutUserOperationLogTest . ONE_TASK_PROCESS ) . deploy ( ) . getId ( ) ; org . camunda . bpm . engine . history . UserOperationLogQuery query = historyService . createUserOperationLogQuery ( ) . deploymentId ( deploymentId ) ; "<AssertPlaceHolder>" ; repositoryService . deleteDeployment ( deploymentId , true ) ; } count ( ) { this . resultType = org . camunda . bpm . engine . impl . AbstractNativeQuery . ResultType . COUNT ; if ( ( commandExecutor ) != null ) { return ( ( java . lang . Long ) ( commandExecutor . execute ( this ) ) ) ; } return executeCount ( org . camunda . bpm . engine . impl . context . Context . getCommandContext ( ) , getParameterMap ( ) ) ; } | org . junit . Assert . assertEquals ( 0 , query . count ( ) ) |
testUpdateClustersToggleKerberosNotInvoked ( ) { org . easymock . Capture < org . apache . ambari . server . controller . AmbariManagementController > controllerCapture = org . easymock . EasyMock . newCapture ( ) ; com . google . inject . Injector injector = createStrictMock ( com . google . inject . Injector . class ) ; org . apache . ambari . server . state . Cluster cluster = createNiceMock ( org . apache . ambari . server . state . Cluster . class ) ; org . apache . ambari . server . actionmanager . ActionManager actionManager = createNiceMock ( org . apache . ambari . server . actionmanager . ActionManager . class ) ; org . apache . ambari . server . controller . ClusterRequest clusterRequest = createNiceMock ( org . apache . ambari . server . controller . ClusterRequest . class ) ; java . util . Set < org . apache . ambari . server . controller . ClusterRequest > setRequests = java . util . Collections . singleton ( clusterRequest ) ; org . apache . ambari . server . controller . KerberosHelper kerberosHelper = createStrictMock ( org . apache . ambari . server . controller . KerberosHelper . class ) ; com . google . inject . Provider < org . apache . ambari . server . agent . stomp . MetadataHolder > m_metadataHolder = createMock ( com . google . inject . Provider . class ) ; org . apache . ambari . server . agent . stomp . MetadataHolder metadataHolder = createMock ( org . apache . ambari . server . agent . stomp . MetadataHolder . class ) ; com . google . inject . Provider < org . apache . ambari . server . agent . stomp . AgentConfigsHolder > m_agentConfigsHolder = createMock ( com . google . inject . Provider . class ) ; org . apache . ambari . server . agent . stomp . AgentConfigsHolder agentConfigsHolder = createMockBuilder ( org . apache . ambari . server . agent . stomp . AgentConfigsHolder . class ) . addMockedMethod ( "updateData" ) . createMock ( ) ; org . apache . ambari . server . controller . AmbariManagementControllerImplTest . constructorInit ( injector , controllerCapture , null , null , kerberosHelper , m_metadataHolder , m_agentConfigsHolder ) ; expect ( m_metadataHolder . get ( ) ) . andReturn ( metadataHolder ) . anyTimes ( ) ; expect ( metadataHolder . updateData ( anyObject ( ) ) ) . andReturn ( true ) . anyTimes ( ) ; expect ( m_agentConfigsHolder . get ( ) ) . andReturn ( agentConfigsHolder ) . anyTimes ( ) ; agentConfigsHolder . updateData ( anyLong ( ) , anyObject ( java . util . List . class ) ) ; expectLastCall ( ) . anyTimes ( ) ; expect ( clusterRequest . getClusterId ( ) ) . andReturn ( 1L ) . times ( 4 ) ; expect ( org . apache . ambari . server . controller . AmbariManagementControllerImplTest . clusters . getClusterById ( 1L ) ) . andReturn ( cluster ) . times ( 1 ) ; replay ( actionManager , cluster , org . apache . ambari . server . controller . AmbariManagementControllerImplTest . clusters , injector , clusterRequest , org . apache . ambari . server . controller . AmbariManagementControllerImplTest . sessionManager , kerberosHelper , m_metadataHolder , metadataHolder , m_agentConfigsHolder , agentConfigsHolder ) ; org . apache . ambari . server . controller . AmbariManagementController controller = partialMockBuilder ( org . apache . ambari . server . controller . AmbariManagementControllerImpl . class ) . withConstructor ( actionManager , org . apache . ambari . server . controller . AmbariManagementControllerImplTest . clusters , injector ) . addMockedMethod ( "getClusterMetadataOnConfigsUpdate" ) . createMock ( ) ; controller . updateClusters ( setRequests , null ) ; "<AssertPlaceHolder>" ; verify ( actionManager , cluster , org . apache . ambari . server . controller . AmbariManagementControllerImplTest . clusters , injector , clusterRequest , org . apache . ambari . server . controller . AmbariManagementControllerImplTest . sessionManager , kerberosHelper , m_metadataHolder , metadataHolder , m_agentConfigsHolder , agentConfigsHolder ) ; } getValue ( ) { java . lang . Object o = ( ( delegate ) == null ) ? null : delegate . getValue ( ) ; return o == null ? null : o . toString ( ) ; } | org . junit . Assert . assertSame ( controller , controllerCapture . getValue ( ) ) |
deveObterAmbienteComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe310 . classes . NFProtocoloInfo protocoloInfo = new com . fincatto . documentofiscal . nfe310 . classes . NFProtocoloInfo ( ) ; final com . fincatto . documentofiscal . DFAmbiente ambiente = com . fincatto . documentofiscal . DFAmbiente . HOMOLOGACAO ; protocoloInfo . setAmbiente ( ambiente ) ; "<AssertPlaceHolder>" ; } getAmbiente ( ) { return this . ambiente ; } | org . junit . Assert . assertEquals ( ambiente , protocoloInfo . getAmbiente ( ) ) |
testAddComment ( ) { try { org . odftoolkit . simple . TextDocument textDoc = org . odftoolkit . simple . TextDocument . loadDocument ( org . odftoolkit . simple . utils . ResourceUtilities . getAbsolutePath ( org . odftoolkit . simple . common . navigation . TextSelectionTest . TEXT_COMMENT_FILE ) ) ; search = new org . odftoolkit . simple . common . navigation . TextNavigation ( "simpleODF" , textDoc ) ; int i = 0 ; while ( search . hasNext ( ) ) { org . odftoolkit . simple . common . navigation . TextSelection item = ( ( org . odftoolkit . simple . common . navigation . TextSelection ) ( search . nextSelection ( ) ) ) ; item . addComment ( "simpleODF<sp>should<sp>be<sp>replaced<sp>by<sp>Simple<sp>ODF." , ( "devin-" + i ) ) ; i ++ ; } "<AssertPlaceHolder>" ; textDoc . save ( org . odftoolkit . simple . utils . ResourceUtilities . newTestOutputFile ( org . odftoolkit . simple . common . navigation . TextSelectionTest . SAVE_FILE_COMMENT ) ) ; } catch ( java . lang . Exception e ) { java . util . logging . Logger . getLogger ( org . odftoolkit . simple . common . navigation . TextSelectionTest . class . getName ( ) ) . log ( Level . SEVERE , e . getMessage ( ) , e ) ; org . junit . Assert . fail ( ( ( ( ( "Failed<sp>with<sp>" + ( e . getClass ( ) . getName ( ) ) ) + ":<sp>'" ) + ( e . getMessage ( ) ) ) + "'" ) ) ; } } addComment ( java . lang . String , java . lang . String ) { org . odftoolkit . odfdom . pkg . OdfFileDom dom = ( ( org . odftoolkit . odfdom . pkg . OdfFileDom ) ( getOdfElement ( ) . getOwnerDocument ( ) ) ) ; org . odftoolkit . odfdom . dom . element . office . OfficeAnnotationElement annotationElement = ( ( org . odftoolkit . odfdom . dom . element . office . OfficeAnnotationElement ) ( org . odftoolkit . odfdom . pkg . OdfXMLFactory . newOdfElement ( dom , org . odftoolkit . odfdom . pkg . OdfName . newName ( OdfDocumentNamespace . OFFICE , "annotation" ) ) ) ) ; getOdfElement ( ) . insertBefore ( annotationElement , getOdfElement ( ) . getFirstChild ( ) ) ; org . odftoolkit . odfdom . dom . element . dc . DcCreatorElement dcCreatorElement = annotationElement . newDcCreatorElement ( ) ; if ( creator == null ) { creator = java . lang . System . getProperty ( "user.name" ) ; } dcCreatorElement . setTextContent ( creator ) ; java . lang . String dcDate = new java . text . SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss" ) . format ( new java . util . Date ( ) ) ; org . odftoolkit . odfdom . dom . element . dc . DcDateElement dcDateElement = annotationElement . newDcDateElement ( ) ; dcDateElement . setTextContent ( dcDate ) ; org . odftoolkit . odfdom . dom . element . text . TextPElement notePElement = annotationElement . newTextPElement ( ) ; org . odftoolkit . odfdom . dom . element . text . TextSpanElement noteSpanElement = notePElement . newTextSpanElement ( ) ; org . odftoolkit . odfdom . incubator . doc . office . OdfOfficeAutomaticStyles styles = null ; if ( dom instanceof org . odftoolkit . odfdom . dom . OdfContentDom ) { styles = ( ( org . odftoolkit . odfdom . dom . OdfContentDom ) ( dom ) ) . getAutomaticStyles ( ) ; } else if ( dom instanceof org . odftoolkit . odfdom . dom . OdfStylesDom ) { styles = ( ( org . odftoolkit . odfdom . dom . OdfStylesDom ) ( dom ) ) . getAutomaticStyles ( ) ; } org . odftoolkit . odfdom . incubator . doc . style . OdfStyle textStyle = styles . newStyle ( OdfStyleFamily . Text ) ; org . odftoolkit . odfdom . dom . element . style . StyleTextPropertiesElement styleTextPropertiesElement = textStyle . newStyleTextPropertiesElement ( null ) ; styleTextPropertiesElement . setStyleFontNameAttribute ( "Tahoma" ) ; styleTextPropertiesElement . setFoFontSizeAttribute ( "10pt" ) ; styleTextPropertiesElement . setStyleFontNameAsianAttribute ( "Lucida<sp>Sans<sp>Unicode" ) ; styleTextPropertiesElement . setStyleFontSizeAsianAttribute ( "12pt" ) ; noteSpanElement . setStyleName ( textStyle . getStyleNameAttribute ( ) ) ; noteSpanElement . setTextContent ( content ) ; } | org . junit . Assert . assertEquals ( 7 , i ) |
testEqualsSameSerial2 ( ) { org . openhab . io . transport . modbus . endpoint . ModbusSerialSlaveEndpoint e1 = new org . openhab . io . transport . modbus . endpoint . ModbusSerialSlaveEndpoint ( "port1" , 9600 , gnu . io . SerialPort . FLOWCONTROL_NONE , gnu . io . SerialPort . FLOWCONTROL_NONE , gnu . io . SerialPort . DATABITS_8 , gnu . io . SerialPort . STOPBITS_1 , gnu . io . SerialPort . PARITY_NONE , net . wimpi . modbus . Modbus . DEFAULT_SERIAL_ENCODING , true , 500 ) ; org . openhab . io . transport . modbus . endpoint . ModbusSerialSlaveEndpoint e2 = new org . openhab . io . transport . modbus . endpoint . ModbusSerialSlaveEndpoint ( "port1" , 9600 , gnu . io . SerialPort . FLOWCONTROL_NONE , gnu . io . SerialPort . FLOWCONTROL_NONE , gnu . io . SerialPort . DATABITS_8 , gnu . io . SerialPort . STOPBITS_1 , gnu . io . SerialPort . PARITY_NONE , net . wimpi . modbus . Modbus . DEFAULT_SERIAL_ENCODING , true , 500 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( e1 , e2 ) |
testImplementation ( ) { org . springframework . context . annotation . AnnotationConfigApplicationContext context = new org . springframework . context . annotation . AnnotationConfigApplicationContext ( org . springframework . retry . annotation . EnableRetryTests . TestConfiguration . class ) ; org . springframework . retry . annotation . EnableRetryTests . NotAnnotatedInterface service = context . getBean ( org . springframework . retry . annotation . EnableRetryTests . NotAnnotatedInterface . class ) ; service . service1 ( ) ; service . service2 ( ) ; "<AssertPlaceHolder>" ; context . close ( ) ; } getCount ( ) { return this . count ; } | org . junit . Assert . assertEquals ( 5 , service . getCount ( ) ) |
testImageRequestDefault ( ) { com . facebook . imagepipeline . core . ImagePipelineConfig . resetDefaultRequestConfig ( ) ; final com . facebook . imagepipeline . request . ImageRequest imageRequest = com . facebook . imagepipeline . request . ImageRequestBuilder . newBuilderWithSource ( mUri ) . build ( ) ; "<AssertPlaceHolder>" ; } getProgressiveRenderingEnabled ( ) { return mProgressiveRenderingEnabled ; } | org . junit . Assert . assertFalse ( imageRequest . getProgressiveRenderingEnabled ( ) ) |
whenOtherServersDefined_adminServerHasNoEnvironmentVariables ( ) { configureServer ( oracle . kubernetes . weblogic . domain . DomainTestBase . SERVER1 ) . withEnvironmentVariable ( oracle . kubernetes . weblogic . domain . DomainTestBase . NAME1 , oracle . kubernetes . weblogic . domain . DomainTestBase . VALUE1 ) . withEnvironmentVariable ( oracle . kubernetes . weblogic . domain . DomainTestBase . NAME2 , oracle . kubernetes . weblogic . domain . DomainTestBase . VALUE2 ) ; oracle . kubernetes . weblogic . domain . model . ServerSpec spec = domain . getAdminServerSpec ( ) ; "<AssertPlaceHolder>" ; } getEnvironmentVariables ( ) { return withStateAdjustments ( server . getEnv ( ) ) ; } | org . junit . Assert . assertThat ( spec . getEnvironmentVariables ( ) , org . hamcrest . Matchers . empty ( ) ) |
testDeleteAllColumns ( ) { org . sagebionetworks . repo . model . table . ColumnModel one = servletTestHelper . createColumnModel ( dispatchServlet , org . sagebionetworks . repo . model . dbo . dao . table . TableModelTestUtils . createColumn ( 0L , "one" , ColumnType . STRING ) , adminUserId ) ; org . sagebionetworks . repo . model . table . ColumnModel two = servletTestHelper . createColumnModel ( dispatchServlet , org . sagebionetworks . repo . model . dbo . dao . table . TableModelTestUtils . createColumn ( 0L , "two" , ColumnType . STRING ) , adminUserId ) ; org . sagebionetworks . repo . model . table . TableEntity table = new org . sagebionetworks . repo . model . table . TableEntity ( ) ; table . setName ( "TableEntity" ) ; table . setParentId ( parent . getId ( ) ) ; table . setColumnIds ( com . google . common . collect . Lists . newArrayList ( one . getId ( ) , two . getId ( ) ) ) ; table = servletTestHelper . createEntity ( dispatchServlet , table , adminUserId ) ; entitiesToDelete . add ( table . getId ( ) ) ; table . setColumnIds ( com . google . common . collect . Lists . < java . lang . String > newArrayList ( ) ) ; table = servletTestHelper . updateEntity ( dispatchServlet , table , adminUserId ) ; "<AssertPlaceHolder>" ; } getColumnIds ( ) { return columnIds ; } | org . junit . Assert . assertEquals ( 0 , table . getColumnIds ( ) . size ( ) ) |
testWriteLockSynchronizes ( ) { org . corfudb . infrastructure . log . MultiReadWriteLock locks = new org . corfudb . infrastructure . log . MultiReadWriteLock ( ) ; java . util . concurrent . CyclicBarrier entry = new java . util . concurrent . CyclicBarrier ( PARAMETERS . CONCURRENCY_SOME ) ; java . util . concurrent . atomic . AtomicBoolean noProblems = new java . util . concurrent . atomic . AtomicBoolean ( true ) ; org . corfudb . infrastructure . log . CallableConsumer c = ( r ) -> { try ( org . corfudb . infrastructure . log . MultiReadWriteLock . AutoCloseableLock ignored = locks . acquireWriteLock ( 1L ) ) { entry . await ( ) ; noProblems . set ( false ) ; } } ; scheduleConcurrently ( PARAMETERS . CONCURRENCY_SOME , c ) ; try { executeScheduled ( PARAMETERS . CONCURRENCY_SOME , PARAMETERS . TIMEOUT_VERY_SHORT ) ; org . junit . Assert . fail ( ) ; } catch ( java . util . concurrent . CancellationException e ) { "<AssertPlaceHolder>" ; } } get ( ) { return counter . get ( ) ; } | org . junit . Assert . assertTrue ( noProblems . get ( ) ) |
testGetFieldIndex ( ) { org . apache . gora . examples . generated . WebPage page = org . apache . gora . examples . generated . WebPage . newBuilder ( ) . build ( ) ; for ( int i = 0 ; i < ( WebPage . SCHEMA . . getFields ( ) . toArray ( ) . length ) ; i ++ ) { int index = page . getSchema ( ) . getFields ( ) . get ( i ) . pos ( ) ; "<AssertPlaceHolder>" ; } } get ( K ) { org . apache . gora . infinispan . store . InfinispanStore . LOG . debug ( ( ( "get(" + key ) + ")" ) ) ; try { return infinispanClient . get ( key ) ; } catch ( java . lang . Exception e ) { throw new org . apache . gora . util . GoraException ( e ) ; } } | org . junit . Assert . assertEquals ( i , index ) |
loadModule_shouldLoadModuleIfItIsCurrentlyNotLoaded ( ) { java . lang . Module test2 = loadModule ( org . openmrs . module . ModuleFactoryTest . MODULE2_PATH , org . openmrs . module . ModuleFactoryTest . MODULE2 , false ) ; org . openmrs . module . ModuleFactory . startModule ( test2 ) ; "<AssertPlaceHolder>" ; } getLoadedModules ( ) { if ( ( org . openmrs . module . ModuleFactory . getLoadedModulesMap ( ) . size ( ) ) > 0 ) { return org . openmrs . module . ModuleFactory . getLoadedModulesMap ( ) . values ( ) ; } return java . util . Collections . emptyList ( ) ; } | org . junit . Assert . assertTrue ( org . openmrs . module . ModuleFactory . getLoadedModules ( ) . contains ( test2 ) ) |
testFetchByPrimaryKeyExisting ( ) { com . liferay . portal . kernel . model . PortletPreferences newPortletPreferences = addPortletPreferences ( ) ; com . liferay . portal . kernel . model . PortletPreferences existingPortletPreferences = _persistence . fetchByPrimaryKey ( newPortletPreferences . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingPortletPreferences , newPortletPreferences ) |
shouldManageUnusedRecordsWithWeirdDataIn ( ) { final java . util . concurrent . atomic . AtomicLong id = new java . util . concurrent . atomic . AtomicLong ( ) ; fixture . apply ( new org . neo4j . consistency . checking . GraphStoreFixture . Transaction ( ) { @ org . neo4j . consistency . checking . full . Override protected void transactionData ( org . neo4j . consistency . checking . GraphStoreFixture . TransactionDataBuilder tx , org . neo4j . consistency . checking . GraphStoreFixture . IdGenerator next ) { id . set ( next . relationship ( ) ) ; org . neo4j . kernel . impl . store . record . RelationshipRecord relationship = new org . neo4j . kernel . impl . store . record . RelationshipRecord ( id . get ( ) ) ; relationship . setFirstNode ( ( - 1 ) ) ; relationship . setSecondNode ( ( - 1 ) ) ; relationship . setInUse ( true ) ; tx . create ( relationship ) ; } } ) ; fixture . apply ( new org . neo4j . consistency . checking . GraphStoreFixture . Transaction ( ) { @ org . neo4j . consistency . checking . full . Override protected void transactionData ( org . neo4j . consistency . checking . GraphStoreFixture . TransactionDataBuilder tx , org . neo4j . consistency . checking . GraphStoreFixture . IdGenerator next ) { org . neo4j . kernel . impl . store . record . RelationshipRecord relationship = new org . neo4j . kernel . impl . store . record . RelationshipRecord ( id . get ( ) ) ; tx . delete ( relationship ) ; } } ) ; org . neo4j . consistency . report . ConsistencySummaryStatistics stats = check ( ) ; "<AssertPlaceHolder>" ; } isConsistent ( ) { return ( totalInconsistencyCount . get ( ) ) == 0 ; } | org . junit . Assert . assertTrue ( stats . isConsistent ( ) ) |
testUpdateRaxaAlert ( ) { org . raxa . module . raxacore . RaxaAlert raxaAlert = dao . getRaxaAlert ( 1 ) ; raxaAlert . setName ( "NewNameList" ) ; dao . updateRaxaAlert ( raxaAlert ) ; java . lang . String name = dao . getRaxaAlert ( 1 ) . getName ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; } | org . junit . Assert . assertEquals ( name , "NewNameList" ) |
whenDivideTwoNumberShouldBeResultCalculation ( ) { chapter1 . typedata . Calculator calc = new chapter1 . typedata . Calculator ( ) ; calc . div ( 2 , 1 ) ; double result = calc . getResult ( ) ; double testResult = 2 ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; } | org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( testResult ) ) |
should_return_this ( ) { org . fest . assertions . api . ByteArrayAssert returned = assertions . startsWith ( sequence ) ; "<AssertPlaceHolder>" ; } startsWith ( long [ ] ) { arrays . assertStartsWith ( description , actual , sequence ) ; return this ; } | org . junit . Assert . assertSame ( returned , assertions ) |
createInstance ( ) { this . setRevisionTo ( "8cf0ce80c2c40c6ec178ef8e5bdc4e2fcdecc7f9" ) ; org . eclipse . winery . common . ids . definitions . ServiceTemplateId id = new org . eclipse . winery . common . ids . definitions . ServiceTemplateId ( "http://winery.opentosca.org/test/servicetemplates/fruits" , "farm" , false ) ; org . eclipse . winery . repository . rest . resources . servicetemplates . ServiceTemplateResource serviceTemplateResource = new org . eclipse . winery . repository . rest . resources . servicetemplates . ServiceTemplateResource ( id ) ; "<AssertPlaceHolder>" ; } setRevisionTo ( java . lang . String ) { this . clean ( ) ; org . eclipse . jgit . api . ResetCommand reset = this . git . reset ( ) ; reset . setMode ( ResetType . HARD ) ; reset . setRef ( ref ) ; reset . call ( ) ; } | org . junit . Assert . assertNotNull ( serviceTemplateResource ) |
testFindElementsByName ( ) { java . util . Random random = new java . util . Random ( ) ; org . openqa . selenium . WebElement text = com . sugarcrm . candybean . examples . mobile . AppiumIosTest . driver . findElements ( org . openqa . selenium . By . name ( "TextField1" ) ) . get ( 0 ) ; int number = ( random . nextInt ( ( ( ( com . sugarcrm . candybean . examples . mobile . AppiumIosTest . MAXIMUM ) - ( com . sugarcrm . candybean . examples . mobile . AppiumIosTest . MINIMUM ) ) + 1 ) ) ) + ( com . sugarcrm . candybean . examples . mobile . AppiumIosTest . MINIMUM ) ; text . sendKeys ( java . lang . String . valueOf ( number ) ) ; org . openqa . selenium . WebElement sumLabel = com . sugarcrm . candybean . examples . mobile . AppiumIosTest . driver . findElements ( org . openqa . selenium . By . name ( "SumLabel" ) ) . get ( 0 ) ; com . sugarcrm . candybean . examples . mobile . AppiumIosTest . driver . findElements ( org . openqa . selenium . By . name ( "ComputeSumButton" ) ) . get ( 0 ) . click ( ) ; "<AssertPlaceHolder>" ; } getText ( ) { logger . info ( ( "Getting<sp>text<sp>for<sp>element:<sp>" + ( this . toString ( ) ) ) ) ; if ( "input" . equals ( we . getTagName ( ) ) ) { return this . we . getAttribute ( "value" ) ; } return this . we . getText ( ) ; } | org . junit . Assert . assertEquals ( sumLabel . getText ( ) , java . lang . String . valueOf ( number ) ) |
testDestroy ( ) { tested . setDomain ( "someDomain" ) ; tested . destroy ( ) ; verify ( cache , times ( 1 ) ) . clear ( ) ; "<AssertPlaceHolder>" ; } getCache ( ) { return cache ; } | org . junit . Assert . assertNull ( tested . getCache ( ) ) |
presetUpdateLimit ( ) { int updateLimit = ( DocumentMK . Builder . DEFAULT_UPDATE_LIMIT ) / 2 ; addConfigurationEntry ( preset , "updateLimit" , updateLimit ) ; org . apache . jackrabbit . oak . plugins . document . Configuration config = createConfiguration ( ) ; "<AssertPlaceHolder>" ; } createConfiguration ( ) { return org . apache . jackrabbit . oak . plugins . document . DocumentNodeStoreServiceConfiguration . create ( context . componentContext ( ) , configAdmin , preset . asConfiguration ( ) , configuration . asConfiguration ( ) ) ; } | org . junit . Assert . assertEquals ( updateLimit , config . updateLimit ( ) ) |
testBackward ( ) { java . sql . Statement stmt = con . createStatement ( ResultSet . TYPE_SCROLL_INSENSITIVE , ResultSet . CONCUR_READ_ONLY ) ; java . sql . ResultSet rs = stmt . executeQuery ( "SELECT<sp>*<sp>FROM<sp>testrs" ) ; rs . afterLast ( ) ; "<AssertPlaceHolder>" ; rs . close ( ) ; stmt . close ( ) ; } previous ( ) { checkScrollable ( ) ; if ( onInsertRow ) { throw new org . postgresql . util . PSQLException ( org . postgresql . util . GT . tr ( "Can''t<sp>use<sp>relative<sp>move<sp>methods<sp>while<sp>on<sp>the<sp>insert<sp>row." ) , org . postgresql . util . PSQLState . INVALID_CURSOR_STATE ) ; } if ( ( ( currentRow ) - 1 ) < 0 ) { currentRow = - 1 ; thisRow = null ; rowBuffer = null ; return false ; } else { ( currentRow ) -- ; } initRowBuffer ( ) ; return true ; } | org . junit . Assert . assertTrue ( rs . previous ( ) ) |
isBundle_nonExistingJar ( ) { aQute . bnd . osgi . Jar jar = new aQute . bnd . osgi . Jar ( "non-existing.jar" ) ; boolean isBundle = utils . isBundle ( jar ) ; "<AssertPlaceHolder>" ; } isBundle ( java . io . File ) { aQute . bnd . osgi . Jar inputJar = null ; try { inputJar = new aQute . bnd . osgi . Jar ( file ) ; return isBundle ( inputJar ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e . getMessage ( ) , e ) ; } finally { if ( inputJar != null ) { inputJar . close ( ) ; } } } | org . junit . Assert . assertFalse ( isBundle ) |
setDefaultValue_TypeBOOLEAN ( ) { parameterParserSpy . setDefaultValue ( defaultValue , strMinValue , strMaxValue , ParameterValueType . BOOLEAN ) ; verify ( parameterParserSpy , times ( 1 ) ) . setDefaultValueForNonDigitalTpye ( strCaptor . capture ( ) , any ( org . oscm . internal . types . enumtypes . ParameterValueType . class ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( defaultValue , strCaptor . getValue ( ) ) |
testGetBatchOfObsoleteIds ( ) { org . mozilla . gecko . sync . ExtendedJSONObject ids = new org . mozilla . gecko . sync . ExtendedJSONObject ( ) ; for ( int i = 0 ; i < ( ( 2 * ( org . mozilla . gecko . background . healthreport . HealthReportConstants . MAXIMUM_DELETIONS_PER_POST ) ) + 10 ) ; i ++ ) { ids . put ( ( "id" + ( 100 - i ) ) , java . lang . Long . valueOf ( ( 100 - i ) ) ) ; } tracker . setObsoleteIds ( ids ) ; java . util . Set < java . lang . String > expected = new java . util . HashSet < java . lang . String > ( ) ; for ( int i = 0 ; i < ( org . mozilla . gecko . background . healthreport . HealthReportConstants . MAXIMUM_DELETIONS_PER_POST ) ; i ++ ) { expected . add ( ( "id" + ( 100 - i ) ) ) ; } "<AssertPlaceHolder>" ; } getBatchOfObsoleteIds ( ) { org . mozilla . gecko . sync . ExtendedJSONObject ids = getObsoleteIds ( ) ; java . util . List < java . util . Map . Entry < java . lang . String , java . lang . Object > > pairs = new java . util . ArrayList < java . util . Map . Entry < java . lang . String , java . lang . Object > > ( ids . entrySet ( ) ) ; java . util . Collections . sort ( pairs , new org . mozilla . gecko . background . healthreport . upload . ObsoleteDocumentTracker . PairComparator ( ) ) ; java . util . List < java . lang . String > batch = new java . util . ArrayList < java . lang . String > ( org . mozilla . gecko . background . healthreport . HealthReportConstants . MAXIMUM_DELETIONS_PER_POST ) ; int i = 0 ; while ( ( ( batch . size ( ) ) < ( org . mozilla . gecko . background . healthreport . HealthReportConstants . MAXIMUM_DELETIONS_PER_POST ) ) && ( i < ( pairs . size ( ) ) ) ) { batch . add ( pairs . get ( ( i ++ ) ) . getKey ( ) ) ; } return batch ; } | org . junit . Assert . assertEquals ( expected , new java . util . HashSet < java . lang . String > ( tracker . getBatchOfObsoleteIds ( ) ) ) |
testUpdateAttachmentsFromRequestIdsAreNull ( ) { javax . portlet . PortletRequest request = org . mockito . Mockito . mock ( javax . portlet . PortletRequest . class ) ; new org . eclipse . sw360 . portal . TestUserCacheHolder ( ) . enable ( ) ; java . util . Set < org . eclipse . sw360 . datahandler . thrift . attachments . Attachment > documentAttachments = com . google . common . collect . ImmutableSet . of ( ) ; "<AssertPlaceHolder>" ; } updateAttachmentsFromRequest ( javax . portlet . PortletRequest , org . eclipse . sw360 . portal . common . Set ) { org . eclipse . sw360 . portal . common . Set < org . eclipse . sw360 . datahandler . thrift . attachments . Attachment > attachments = com . google . common . collect . Sets . newHashSet ( ) ; org . eclipse . sw360 . datahandler . thrift . users . User user = org . eclipse . sw360 . portal . users . UserCacheHolder . getUserFromRequest ( request ) ; java . lang . String [ ] ids = request . getParameterValues ( ( ( Release . _Fields . ATTACHMENTS . toString ( ) ) + ( Attachment . _Fields . ATTACHMENT_CONTENT_ID . toString ( ) ) ) ) ; java . lang . String [ ] fileNames = request . getParameterValues ( ( ( Release . _Fields . ATTACHMENTS . toString ( ) ) + ( Attachment . _Fields . FILENAME . toString ( ) ) ) ) ; java . lang . String [ ] types = request . getParameterValues ( ( ( Release . _Fields . ATTACHMENTS . toString ( ) ) + ( Attachment . _Fields . ATTACHMENT_TYPE . toString ( ) ) ) ) ; java . lang . String [ ] createdComments = request . getParameterValues ( ( ( Release . _Fields . ATTACHMENTS . toString ( ) ) + ( Attachment . _Fields . CREATED_COMMENT . toString ( ) ) ) ) ; java . lang . String [ ] checkStatuses = request . getParameterValues ( ( ( Release . _Fields . ATTACHMENTS . toString ( ) ) + ( Attachment . _Fields . CHECK_STATUS . toString ( ) ) ) ) ; java . lang . String [ ] checkedComments = request . getParameterValues ( ( ( Release . _Fields . ATTACHMENTS . toString ( ) ) + ( Attachment . _Fields . CHECKED_COMMENT . toString ( ) ) ) ) ; if ( ( ids == null ) || ( ( ids . length ) == 0 ) ) { org . eclipse . sw360 . portal . common . PortletUtils . LOGGER . info ( "No<sp>ids<sp>transmitted.<sp>All<sp>attachments<sp>will<sp>be<sp>deleted." ) ; return attachments ; } else if ( org . eclipse . sw360 . datahandler . common . CommonUtils . oneIsNull ( fileNames , types , createdComments , checkStatuses , checkedComments ) ) { org . eclipse . sw360 . portal . common . PortletUtils . LOGGER . error ( "Invalid<sp>request<sp>content.<sp>One<sp>of<sp>the<sp>attachment<sp>parameters<sp>is<sp>null.<sp>No<sp>attachments<sp>will<sp>be<sp>saved<sp>or<sp>deleted." ) ; return documentAttachments ; } else if ( ! ( org . eclipse . sw360 . datahandler . common . CommonUtils . allHaveSameLength ( ids , fileNames , types , createdComments , checkStatuses , checkedComments ) ) ) { org . eclipse . sw360 . portal . common . PortletUtils . LOGGER . error ( "Not<sp>all<sp>of<sp>the<sp>attachment<sp>parameter<sp>arrays<sp>have<sp>the<sp>same<sp>length!<sp>No<sp>attachments<sp>will<sp>be<sp>saved<sp>or<sp>deleted." ) ; return documentAttachments ; } org . eclipse . sw360 . portal . common . Map < java . lang . String , org . eclipse . sw360 . datahandler . thrift . attachments . Attachment > documentAttachmentMap = org . eclipse . sw360 . datahandler . common . CommonUtils . nullToEmptySet ( documentAttachments ) . stream ( ) . collect ( java . util . stream . Collectors . toMap ( Attachment :: getAttachmentContentId , java . util . function . Function . identity ( ) ) ) ; for ( int i = 0 ; i < ( ids . length ) ; ++ i ) { java . lang . String id = ids [ i ] ; org . eclipse . sw360 . datahandler . thrift . attachments . Attachment attachment = documentAttachmentMap . get ( id ) ; if ( attachment == null ) { attachment = org . eclipse . sw360 . datahandler . common . CommonUtils . getNewAttachment ( user , id , fileNames [ i ] ) ; documentAttachmentMap . put ( attachment . getAttachmentContentId ( ) , attachment ) ; } attachment . setAttachmentType ( org . eclipse . sw360 . portal . common . PortletUtils . getAttachmentTypefromString ( types [ i ] ) ) ; attachment . setCreatedComment ( createdComments [ i ] ) ; if ( ( org . eclipse . sw360 . portal . common . PortletUtils . getCheckStatusfromString ( checkStatuses [ i ] ) ) != ( org . eclipse . sw360 . datahandler . thrift . attachments . CheckStatus . NOTCHECKED ) ) { if ( ( ( attachment . checkStatus ) != ( org . eclipse . sw360 . portal . common . PortletUtils . getCheckStatusfromString ( checkStatuses [ i ] ) ) ) || ( ! ( checkedComments [ i ] . equals ( attachment . checkedComment ) ) ) ) { attachment . setCheckedOn ( org . eclipse . sw360 . datahandler . common . SW360Utils . getCreatedOn ( ) ) ; attachment . setCheckedBy ( org . eclipse . sw360 . portal . users . UserCacheHolder . getUserFromRequest ( request ) . getEmail ( ) ) ; attachment . setCheckedTeam ( org . eclipse . sw360 . portal . users . UserCacheHolder . getUserFromRequest ( request ) . getDepartment ( ) ) ; attachment . setCheckedComment ( checkedComments [ i ] ) ; } } else { attachment . setCheckedOn ( null ) ; attachment . setCheckedBy ( null ) ; attachment . setCheckedTeam ( null ) ; attachment . setCheckedComment ( "" ) ; } attachment | org . junit . Assert . assertThat ( org . eclipse . sw360 . portal . common . PortletUtils . updateAttachmentsFromRequest ( request , documentAttachments ) , org . hamcrest . core . Is . is ( org . hamcrest . Matchers . empty ( ) ) ) |
testInitialUpdate ( ) { org . candlepin . model . Product prod = org . candlepin . test . TestUtil . createProduct ( "test-label" , "test-product-name" ) ; productCurator . create ( prod ) ; "<AssertPlaceHolder>" ; } getUpdated ( ) { return updated ; } | org . junit . Assert . assertNotNull ( prod . getUpdated ( ) ) |
testCopyFormSize ( ) { for ( java . lang . String bcp47tag : PoPluralRule . mappingForNonDefault . keySet ( ) ) { com . ibm . icu . text . PluralRules cldrPluralRule = com . ibm . icu . text . PluralRules . forLocale ( java . util . Locale . forLanguageTag ( bcp47tag ) ) ; int cldrSize = cldrPluralRule . getKeywords ( ) . size ( ) ; int poSize = com . box . l10n . mojito . po . PoPluralRule . fromBcp47Tag ( bcp47tag ) . getCldrForms ( ) . size ( ) ; int copySize = com . box . l10n . mojito . po . PoPluralRule . fromBcp47Tag ( bcp47tag ) . getFormsToCopyOnImport ( ) . getFormMap ( ) . values ( ) . size ( ) ; com . box . l10n . mojito . po . PoPluralRuleTest . logger . debug ( "{}<sp>--><sp>cldr<sp>size:<sp>{},<sp>po<sp>size:<sp>{},<sp>copy<sp>size:<sp>{}" , bcp47tag , cldrSize , poSize , copySize ) ; "<AssertPlaceHolder>" ; } } getFormMap ( ) { return formMap ; } | org . junit . Assert . assertEquals ( copySize , ( cldrSize - poSize ) ) |
testAddInterfaceAddres ( ) { ipInterfaceAddressTlv . addInterfaceAddres ( ip4Address ) ; resultList = ipInterfaceAddressTlv . interfaceAddress ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; } | org . junit . Assert . assertThat ( resultList . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) ) |
nullFileShouldReturnNull ( ) { "<AssertPlaceHolder>" ; } getFile ( java . lang . String ) { if ( fileName == null ) { return null ; } final java . net . URL url = lcmc . common . domain . util . Tools . class . getResource ( fileName ) ; if ( url == null ) { return null ; } try { final java . io . BufferedReader br = new java . io . BufferedReader ( new java . io . InputStreamReader ( url . openStream ( ) , "UTF-8" ) ) ; final java . lang . StringBuilder content = new java . lang . StringBuilder ( "" ) ; while ( br . ready ( ) ) { content . append ( br . readLine ( ) ) ; content . append ( '\n' ) ; } return content . toString ( ) ; } catch ( final java . io . IOException e ) { lcmc . common . domain . util . Tools . LOG . appError ( ( "getFile:<sp>could<sp>not<sp>read:<sp>" + fileName ) , "" , e ) ; return null ; } } | org . junit . Assert . assertNull ( lcmc . common . domain . util . Tools . getFile ( null ) ) |
iterator_isEmptyAfterCreation ( ) { "<AssertPlaceHolder>" ; } iterator ( ) { final java . util . Iterator wrappedIterator = wrappedSet . iterator ( ) ; return new java . util . Iterator ( ) { public boolean hasNext ( ) { return wrappedIterator . hasNext ( ) ; } public java . lang . Object next ( ) { return ( ( org . eclipse . jface . internal . databinding . viewers . ViewerElementWrapper ) ( wrappedIterator . next ( ) ) ) . unwrap ( ) ; } public void remove ( ) { wrappedIterator . remove ( ) ; } } ; } | org . junit . Assert . assertFalse ( object . iterator ( ) . hasNext ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.