How to use stream class

Best Atoum code snippet using stream

StreamExpression.html

Source:StreamExpression.html Github

copy

Full Screen

...3<html lang="en">4<head>5<!-- Generated by javadoc (version 1.7.0_55) on Wed Feb 08 19:13:25 CET 2017 -->6<meta http-equiv="Content-Type" content="text/html" charset="utf-8">7<title>Uses of Class org.apache.solr.client.solrj.io.stream.expr.StreamExpression (Solr 5.5.4 API)</title>8<meta name="date" content="2017-02-08">9<link rel="stylesheet" type="text/css" href="../../../../../../../../../stylesheet.css" title="Style">10</head>11<body>12<script type="text/javascript"><!--13 if (location.href.indexOf('is-external=true') == -1) {14 parent.document.title="Uses of Class org.apache.solr.client.solrj.io.stream.expr.StreamExpression (Solr 5.5.4 API)";15 }16//-->17</script>18<noscript>19<div>JavaScript is disabled on your browser.</div>20</noscript>21<!-- ========= START OF TOP NAVBAR ======= -->22<div class="topNav"><a name="navbar_top">23<!-- -->24</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">25<!-- -->26</a>27<ul class="navList" title="Navigation">28<li><a href="../../../../../../../../../overview-summary.html">Overview</a></li>29<li><a href="../package-summary.html">Package</a></li>30<li><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">Class</a></li>31<li class="navBarCell1Rev">Use</li>32<li><a href="../package-tree.html">Tree</a></li>33<li><a href="../../../../../../../../../deprecated-list.html">Deprecated</a></li>34<li><a href="../../../../../../../../../help-doc.html">Help</a></li>35</ul>36</div>37<div class="subNav">38<ul class="navList">39<li>Prev</li>40<li>Next</li>41</ul>42<ul class="navList">43<li><a href="../../../../../../../../../index.html?org/apache/solr/client/solrj/io/stream/expr/class-use/StreamExpression.html" target="_top">Frames</a></li>44<li><a href="StreamExpression.html" target="_top">No Frames</a></li>45</ul>46<ul class="navList" id="allclasses_navbar_top">47<li><a href="../../../../../../../../../allclasses-noframe.html">All Classes</a></li>48</ul>49<div>50<script type="text/javascript"><!--51 allClassesLink = document.getElementById("allclasses_navbar_top");52 if(window==top) {53 allClassesLink.style.display = "block";54 }55 else {56 allClassesLink.style.display = "none";57 }58 //-->59</script>60</div>61<a name="skip-navbar_top">62<!-- -->63</a></div>64<!-- ========= END OF TOP NAVBAR ========= -->65<div class="header">66<h2 title="Uses of Class org.apache.solr.client.solrj.io.stream.expr.StreamExpression" class="title">Uses of Class<br>org.apache.solr.client.solrj.io.stream.expr.StreamExpression</h2>67</div>68<div class="classUseContainer">69<ul class="blockList">70<li class="blockList">71<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">72<caption><span>Packages that use <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></span><span class="tabEnd">&nbsp;</span></caption>73<tr>74<th class="colFirst" scope="col">Package</th>75<th class="colLast" scope="col">Description</th>76</tr>77<tbody>78<tr class="altColor">79<td class="colFirst"><a href="#org.apache.solr.client.solrj.io.stream">org.apache.solr.client.solrj.io.stream</a></td>80<td class="colLast">81<div class="block">Stream implementations for the Streaming Aggregation API</div>82</td>83</tr>84<tr class="rowColor">85<td class="colFirst"><a href="#org.apache.solr.client.solrj.io.stream.expr">org.apache.solr.client.solrj.io.stream.expr</a></td>86<td class="colLast">87<div class="block">Expression language for the Streaming Aggregation API</div>88</td>89</tr>90</tbody>91</table>92</li>93<li class="blockList">94<ul class="blockList">95<li class="blockList"><a name="org.apache.solr.client.solrj.io.stream">96<!-- -->97</a>98<h3>Uses of <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a> in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/package-summary.html">org.apache.solr.client.solrj.io.stream</a></h3>99<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">100<caption><span>Methods in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/package-summary.html">org.apache.solr.client.solrj.io.stream</a> that return <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></span><span class="tabEnd">&nbsp;</span></caption>101<tr>102<th class="colFirst" scope="col">Modifier and Type</th>103<th class="colLast" scope="col">Method and Description</th>104</tr>105<tbody>106<tr class="altColor">107<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>108<td class="colLast"><span class="strong">ReducerStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/ReducerStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>109</tr>110<tr class="rowColor">111<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>112<td class="colLast"><span class="strong">ParallelStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/ParallelStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>113</tr>114<tr class="altColor">115<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>116<td class="colLast"><span class="strong">UniqueStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/UniqueStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>117</tr>118<tr class="rowColor">119<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>120<td class="colLast"><span class="strong">RankStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/RankStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>121</tr>122<tr class="altColor">123<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>124<td class="colLast"><span class="strong">MergeStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/MergeStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>125</tr>126</tbody>127</table>128<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">129<caption><span>Constructors in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/package-summary.html">org.apache.solr.client.solrj.io.stream</a> with parameters of type <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></span><span class="tabEnd">&nbsp;</span></caption>130<tr>131<th class="colOne" scope="col">Constructor and Description</th>132</tr>133<tbody>134<tr class="altColor">135<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/CloudSolrStream.html#CloudSolrStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">CloudSolrStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,136 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>137</tr>138<tr class="rowColor">139<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/MergeStream.html#MergeStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">MergeStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,140 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>141</tr>142<tr class="altColor">143<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/ParallelStream.html#ParallelStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">ParallelStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,144 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>145</tr>146<tr class="rowColor">147<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/RankStream.html#RankStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">RankStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,148 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>149</tr>150<tr class="altColor">151<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/ReducerStream.html#ReducerStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">ReducerStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,152 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>153</tr>154<tr class="rowColor">155<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/UniqueStream.html#UniqueStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">UniqueStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,156 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>157</tr>158</tbody>159</table>160</li>161<li class="blockList"><a name="org.apache.solr.client.solrj.io.stream.expr">162<!-- -->163</a>164<h3>Uses of <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a> in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/package-summary.html">org.apache.solr.client.solrj.io.stream.expr</a></h3>165<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">166<caption><span>Methods in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/package-summary.html">org.apache.solr.client.solrj.io.stream.expr</a> that return <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></span><span class="tabEnd">&nbsp;</span></caption>167<tr>168<th class="colFirst" scope="col">Modifier and Type</th>169<th class="colLast" scope="col">Method and Description</th>170</tr>171<tbody>172<tr class="altColor">173<td class="colFirst"><code>static <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>174<td class="colLast"><span class="strong">StreamExpressionParser.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParser.html#parse(java.lang.String)">parse</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;clause)</code>&nbsp;</td>175</tr>176<tr class="rowColor">177<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>178<td class="colLast"><span class="strong">StreamExpression.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html#withFunctionName(java.lang.String)">withFunctionName</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;functionName)</code>&nbsp;</td>179</tr>180<tr class="altColor">181<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>182<td class="colLast"><span class="strong">StreamExpression.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html#withParameter(org.apache.solr.client.solrj.io.stream.expr.StreamExpressionParameter)">withParameter</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a>&nbsp;parameter)</code>&nbsp;</td>183</tr>184<tr class="rowColor">185<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>186<td class="colLast"><span class="strong">StreamExpression.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html#withParameter(java.lang.String)">withParameter</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;parameter)</code>&nbsp;</td>187</tr>188<tr class="altColor">189<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>190<td class="colLast"><span class="strong">StreamExpression.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html#withParameters(java.util.List)">withParameters</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a>&gt;&nbsp;parameters)</code>&nbsp;</td>191</tr>192</tbody>193</table>194<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">195<caption><span>Methods in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/package-summary.html">org.apache.solr.client.solrj.io.stream.expr</a> that return types with arguments of type <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></span><span class="tabEnd">&nbsp;</span></caption>196<tr>197<th class="colFirst" scope="col">Modifier and Type</th>198<th class="colLast" scope="col">Method and Description</th>199</tr>200<tbody>201<tr class="altColor">202<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&gt;</code></td>203<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getExpressionOperands(org.apache.solr.client.solrj.io.stream.expr.StreamExpression)">getExpressionOperands</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression)</code>&nbsp;</td>204</tr>205<tr class="rowColor">206<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&gt;</code></td>207<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getExpressionOperands(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, java.lang.String)">getExpressionOperands</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,208 <a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;functionName)</code>&nbsp;</td>209</tr>210<tr class="altColor">211<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&gt;</code></td>212<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getExpressionOperandsRepresentingTypes(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, java.lang.Class...)">getExpressionOperandsRepresentingTypes</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,213 <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>...&nbsp;clazzes)</code>&nbsp;</td>214</tr>215</tbody>216</table>217<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">218<caption><span>Methods in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/package-summary.html">org.apache.solr.client.solrj.io.stream.expr</a> with parameters of type <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></span><span class="tabEnd">&nbsp;</span></caption>219<tr>220<th class="colFirst" scope="col">Modifier and Type</th>221<th class="colLast" scope="col">Method and Description</th>222</tr>223<tbody>224<tr class="altColor">225<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/TupleStream.html" title="class in org.apache.solr.client.solrj.io.stream">TupleStream</a></code></td>226<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#constructStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression)">constructStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression)</code>&nbsp;</td>227</tr>228<tr class="rowColor">229<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&gt;</code></td>230<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getExpressionOperands(org.apache.solr.client.solrj.io.stream.expr.StreamExpression)">getExpressionOperands</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression)</code>&nbsp;</td>231</tr>232<tr class="altColor">233<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&gt;</code></td>234<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getExpressionOperands(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, java.lang.String)">getExpressionOperands</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,235 <a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;functionName)</code>&nbsp;</td>236</tr>237<tr class="rowColor">238<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&gt;</code></td>239<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getExpressionOperandsRepresentingTypes(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, java.lang.Class...)">getExpressionOperandsRepresentingTypes</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,240 <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>...&nbsp;clazzes)</code>&nbsp;</td>241</tr>242<tr class="altColor">243<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionNamedParameter.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionNamedParameter</a></code></td>244<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getNamedOperand(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, java.lang.String)">getNamedOperand</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,245 <a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>&nbsp;</td>246</tr>247<tr class="rowColor">248<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionNamedParameter.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionNamedParameter</a>&gt;</code></td>249<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getNamedOperands(org.apache.solr.client.solrj.io.stream.expr.StreamExpression)">getNamedOperands</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression)</code>&nbsp;</td>250</tr>251<tr class="altColor">252<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a></code></td>253<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getOperand(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, int)">getOperand</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,254 int&nbsp;parameterIndex)</code>&nbsp;</td>255</tr>256<tr class="rowColor">257<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a>&gt;</code></td>258<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getOperandsOfType(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, java.lang.Class...)">getOperandsOfType</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,259 <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>...&nbsp;clazzes)</code>&nbsp;</td>260</tr>261<tr class="altColor">262<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>263<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#getValueOperand(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, int)">getValueOperand</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,264 int&nbsp;parameterIndex)</code>265<div class="block">Given an expression, will return the value parameter at the given index, or null if doesn't exist</div>266</td>267</tr>268</tbody>269</table>270</li>271</ul>272</li>273</ul>274</div>275<!-- ======= START OF BOTTOM NAVBAR ====== -->276<div class="bottomNav"><a name="navbar_bottom">277<!-- -->278</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">279<!-- -->280</a>281<ul class="navList" title="Navigation">282<li><a href="../../../../../../../../../overview-summary.html">Overview</a></li>283<li><a href="../package-summary.html">Package</a></li>284<li><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">Class</a></li>285<li class="navBarCell1Rev">Use</li>286<li><a href="../package-tree.html">Tree</a></li>287<li><a href="../../../../../../../../../deprecated-list.html">Deprecated</a></li>288<li><a href="../../../../../../../../../help-doc.html">Help</a></li>289</ul>290</div>291<div class="subNav">292<ul class="navList">293<li>Prev</li>294<li>Next</li>295</ul>296<ul class="navList">297<li><a href="../../../../../../../../../index.html?org/apache/solr/client/solrj/io/stream/expr/class-use/StreamExpression.html" target="_top">Frames</a></li>298<li><a href="StreamExpression.html" target="_top">No Frames</a></li>299</ul>300<ul class="navList" id="allclasses_navbar_bottom">301<li><a href="../../../../../../../../../allclasses-noframe.html">All Classes</a></li>302</ul>303<div>304<script type="text/javascript"><!--305 allClassesLink = document.getElementById("allclasses_navbar_bottom");306 if(window==top) {307 allClassesLink.style.display = "block";308 }309 else {310 allClassesLink.style.display = "none";311 }...

Full Screen

Full Screen

StreamFactory.html

Source:StreamFactory.html Github

copy

Full Screen

...3<html lang="en">4<head>5<!-- Generated by javadoc (version 1.7.0_55) on Wed Feb 08 19:13:25 CET 2017 -->6<meta http-equiv="Content-Type" content="text/html" charset="utf-8">7<title>Uses of Class org.apache.solr.client.solrj.io.stream.expr.StreamFactory (Solr 5.5.4 API)</title>8<meta name="date" content="2017-02-08">9<link rel="stylesheet" type="text/css" href="../../../../../../../../../stylesheet.css" title="Style">10</head>11<body>12<script type="text/javascript"><!--13 if (location.href.indexOf('is-external=true') == -1) {14 parent.document.title="Uses of Class org.apache.solr.client.solrj.io.stream.expr.StreamFactory (Solr 5.5.4 API)";15 }16//-->17</script>18<noscript>19<div>JavaScript is disabled on your browser.</div>20</noscript>21<!-- ========= START OF TOP NAVBAR ======= -->22<div class="topNav"><a name="navbar_top">23<!-- -->24</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">25<!-- -->26</a>27<ul class="navList" title="Navigation">28<li><a href="../../../../../../../../../overview-summary.html">Overview</a></li>29<li><a href="../package-summary.html">Package</a></li>30<li><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">Class</a></li>31<li class="navBarCell1Rev">Use</li>32<li><a href="../package-tree.html">Tree</a></li>33<li><a href="../../../../../../../../../deprecated-list.html">Deprecated</a></li>34<li><a href="../../../../../../../../../help-doc.html">Help</a></li>35</ul>36</div>37<div class="subNav">38<ul class="navList">39<li>Prev</li>40<li>Next</li>41</ul>42<ul class="navList">43<li><a href="../../../../../../../../../index.html?org/apache/solr/client/solrj/io/stream/expr/class-use/StreamFactory.html" target="_top">Frames</a></li>44<li><a href="StreamFactory.html" target="_top">No Frames</a></li>45</ul>46<ul class="navList" id="allclasses_navbar_top">47<li><a href="../../../../../../../../../allclasses-noframe.html">All Classes</a></li>48</ul>49<div>50<script type="text/javascript"><!--51 allClassesLink = document.getElementById("allclasses_navbar_top");52 if(window==top) {53 allClassesLink.style.display = "block";54 }55 else {56 allClassesLink.style.display = "none";57 }58 //-->59</script>60</div>61<a name="skip-navbar_top">62<!-- -->63</a></div>64<!-- ========= END OF TOP NAVBAR ========= -->65<div class="header">66<h2 title="Uses of Class org.apache.solr.client.solrj.io.stream.expr.StreamFactory" class="title">Uses of Class<br>org.apache.solr.client.solrj.io.stream.expr.StreamFactory</h2>67</div>68<div class="classUseContainer">69<ul class="blockList">70<li class="blockList">71<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">72<caption><span>Packages that use <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a></span><span class="tabEnd">&nbsp;</span></caption>73<tr>74<th class="colFirst" scope="col">Package</th>75<th class="colLast" scope="col">Description</th>76</tr>77<tbody>78<tr class="altColor">79<td class="colFirst"><a href="#org.apache.solr.client.solrj.io.comp">org.apache.solr.client.solrj.io.comp</a></td>80<td class="colLast">81<div class="block">Comparators for the Streaming Aggregation API</div>82</td>83</tr>84<tr class="rowColor">85<td class="colFirst"><a href="#org.apache.solr.client.solrj.io.stream">org.apache.solr.client.solrj.io.stream</a></td>86<td class="colLast">87<div class="block">Stream implementations for the Streaming Aggregation API</div>88</td>89</tr>90<tr class="altColor">91<td class="colFirst"><a href="#org.apache.solr.client.solrj.io.stream.expr">org.apache.solr.client.solrj.io.stream.expr</a></td>92<td class="colLast">93<div class="block">Expression language for the Streaming Aggregation API</div>94</td>95</tr>96</tbody>97</table>98</li>99<li class="blockList">100<ul class="blockList">101<li class="blockList"><a name="org.apache.solr.client.solrj.io.comp">102<!-- -->103</a>104<h3>Uses of <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a> in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/comp/package-summary.html">org.apache.solr.client.solrj.io.comp</a></h3>105<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">106<caption><span>Methods in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/comp/package-summary.html">org.apache.solr.client.solrj.io.comp</a> with parameters of type <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a></span><span class="tabEnd">&nbsp;</span></caption>107<tr>108<th class="colFirst" scope="col">Modifier and Type</th>109<th class="colLast" scope="col">Method and Description</th>110</tr>111<tbody>112<tr class="altColor">113<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a></code></td>114<td class="colLast"><span class="strong">ExpressibleComparator.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/comp/ExpressibleComparator.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>115</tr>116<tr class="rowColor">117<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a></code></td>118<td class="colLast"><span class="strong">FieldComparator.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/comp/FieldComparator.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>119</tr>120<tr class="altColor">121<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a></code></td>122<td class="colLast"><span class="strong">MultiComp.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/comp/MultiComp.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>123</tr>124</tbody>125</table>126</li>127<li class="blockList"><a name="org.apache.solr.client.solrj.io.stream">128<!-- -->129</a>130<h3>Uses of <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a> in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/package-summary.html">org.apache.solr.client.solrj.io.stream</a></h3>131<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">132<caption><span>Methods in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/package-summary.html">org.apache.solr.client.solrj.io.stream</a> that return <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a></span><span class="tabEnd">&nbsp;</span></caption>133<tr>134<th class="colFirst" scope="col">Modifier and Type</th>135<th class="colLast" scope="col">Method and Description</th>136</tr>137<tbody>138<tr class="altColor">139<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a></code></td>140<td class="colLast"><span class="strong">StreamContext.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/StreamContext.html#getStreamFactory()">getStreamFactory</a></strong>()</code>&nbsp;</td>141</tr>142</tbody>143</table>144<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">145<caption><span>Methods in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/package-summary.html">org.apache.solr.client.solrj.io.stream</a> with parameters of type <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a></span><span class="tabEnd">&nbsp;</span></caption>146<tr>147<th class="colFirst" scope="col">Modifier and Type</th>148<th class="colLast" scope="col">Method and Description</th>149</tr>150<tbody>151<tr class="altColor">152<td class="colFirst"><code>void</code></td>153<td class="colLast"><span class="strong">StreamContext.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/StreamContext.html#setStreamFactory(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">setStreamFactory</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;streamFactory)</code>&nbsp;</td>154</tr>155<tr class="rowColor">156<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>157<td class="colLast"><span class="strong">ReducerStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/ReducerStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>158</tr>159<tr class="altColor">160<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>161<td class="colLast"><span class="strong">ParallelStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/ParallelStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>162</tr>163<tr class="rowColor">164<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a></code></td>165<td class="colLast"><span class="strong">PushBackStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/PushBackStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>166</tr>167<tr class="altColor">168<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a></code></td>169<td class="colLast"><span class="strong">CloudSolrStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/CloudSolrStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>170</tr>171<tr class="rowColor">172<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>173<td class="colLast"><span class="strong">UniqueStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/UniqueStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>174</tr>175<tr class="altColor">176<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpressionParameter.html" title="interface in org.apache.solr.client.solrj.io.stream.expr">StreamExpressionParameter</a></code></td>177<td class="colLast"><span class="strong">ExpressibleStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/ExpressibleStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>178</tr>179<tr class="rowColor">180<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>181<td class="colLast"><span class="strong">RankStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/RankStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>182</tr>183<tr class="altColor">184<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a></code></td>185<td class="colLast"><span class="strong">MergeStream.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/MergeStream.html#toExpression(org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">toExpression</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>186</tr>187</tbody>188</table>189<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">190<caption><span>Constructors in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/package-summary.html">org.apache.solr.client.solrj.io.stream</a> with parameters of type <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a></span><span class="tabEnd">&nbsp;</span></caption>191<tr>192<th class="colOne" scope="col">Constructor and Description</th>193</tr>194<tbody>195<tr class="altColor">196<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/CloudSolrStream.html#CloudSolrStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">CloudSolrStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,197 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>198</tr>199<tr class="rowColor">200<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/MergeStream.html#MergeStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">MergeStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,201 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>202</tr>203<tr class="altColor">204<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/ParallelStream.html#ParallelStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">ParallelStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,205 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>206</tr>207<tr class="rowColor">208<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/RankStream.html#RankStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">RankStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,209 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>210</tr>211<tr class="altColor">212<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/ReducerStream.html#ReducerStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">ReducerStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,213 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>214</tr>215<tr class="rowColor">216<td class="colLast"><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/UniqueStream.html#UniqueStream(org.apache.solr.client.solrj.io.stream.expr.StreamExpression, org.apache.solr.client.solrj.io.stream.expr.StreamFactory)">UniqueStream</a></strong>(<a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamExpression.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamExpression</a>&nbsp;expression,217 <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a>&nbsp;factory)</code>&nbsp;</td>218</tr>219</tbody>220</table>221</li>222<li class="blockList"><a name="org.apache.solr.client.solrj.io.stream.expr">223<!-- -->224</a>225<h3>Uses of <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a> in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/package-summary.html">org.apache.solr.client.solrj.io.stream.expr</a></h3>226<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">227<caption><span>Methods in <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/package-summary.html">org.apache.solr.client.solrj.io.stream.expr</a> that return <a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a></span><span class="tabEnd">&nbsp;</span></caption>228<tr>229<th class="colFirst" scope="col">Modifier and Type</th>230<th class="colLast" scope="col">Method and Description</th>231</tr>232<tbody>233<tr class="altColor">234<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a></code></td>235<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#withCollectionZkHost(java.lang.String, java.lang.String)">withCollectionZkHost</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;collectionName,236 <a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;zkHost)</code>&nbsp;</td>237</tr>238<tr class="rowColor">239<td class="colFirst"><code><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">StreamFactory</a></code></td>240<td class="colLast"><span class="strong">StreamFactory.</span><code><strong><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html#withStreamFunction(java.lang.String, java.lang.Class)">withStreamFunction</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;streamFunction,241 <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;clazz)</code>&nbsp;</td>242</tr>243</tbody>244</table>245</li>246</ul>247</li>248</ul>249</div>250<!-- ======= START OF BOTTOM NAVBAR ====== -->251<div class="bottomNav"><a name="navbar_bottom">252<!-- -->253</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">254<!-- -->255</a>256<ul class="navList" title="Navigation">257<li><a href="../../../../../../../../../overview-summary.html">Overview</a></li>258<li><a href="../package-summary.html">Package</a></li>259<li><a href="../../../../../../../../../org/apache/solr/client/solrj/io/stream/expr/StreamFactory.html" title="class in org.apache.solr.client.solrj.io.stream.expr">Class</a></li>260<li class="navBarCell1Rev">Use</li>261<li><a href="../package-tree.html">Tree</a></li>262<li><a href="../../../../../../../../../deprecated-list.html">Deprecated</a></li>263<li><a href="../../../../../../../../../help-doc.html">Help</a></li>264</ul>265</div>266<div class="subNav">267<ul class="navList">268<li>Prev</li>269<li>Next</li>270</ul>271<ul class="navList">272<li><a href="../../../../../../../../../index.html?org/apache/solr/client/solrj/io/stream/expr/class-use/StreamFactory.html" target="_top">Frames</a></li>273<li><a href="StreamFactory.html" target="_top">No Frames</a></li>274</ul>275<ul class="navList" id="allclasses_navbar_bottom">276<li><a href="../../../../../../../../../allclasses-noframe.html">All Classes</a></li>277</ul>278<div>279<script type="text/javascript"><!--280 allClassesLink = document.getElementById("allclasses_navbar_bottom");281 if(window==top) {282 allClassesLink.style.display = "block";283 }284 else {285 allClassesLink.style.display = "none";286 }...

Full Screen

Full Screen

writesched_priority_test.go

Source:writesched_priority_test.go Github

copy

Full Screen

...96 t.Error(err)97 }98}99func TestPriorityAdjustExclusiveZero(t *testing.T) {100 // 1, 2, and 3 are all children of the 0 stream.101 // Exclusive reprioritization to any of the streams should bring102 // the rest of the streams under the reprioritized stream.103 ws := defaultPriorityWriteScheduler()104 ws.OpenStream(1, OpenStreamOptions{})105 ws.OpenStream(2, OpenStreamOptions{})106 ws.OpenStream(3, OpenStreamOptions{})107 want := "1{weight:15,parent:0} 2{weight:15,parent:0} 3{weight:15,parent:0}"108 if got := fmtTree(ws, fmtNodeWeightParentSkipRoot); got != want {109 t.Errorf("After open\ngot %q\nwant %q", got, want)110 }111 ws.AdjustStream(2, PriorityParam{112 StreamDep: 0,113 Weight: 20,114 Exclusive: true,115 })116 want = "1{weight:15,parent:2} 2{weight:20,parent:0} 3{weight:15,parent:2}"117 if got := fmtTree(ws, fmtNodeWeightParentSkipRoot); got != want {118 t.Errorf("After adjust\ngot %q\nwant %q", got, want)119 }120 if err := checkPriorityWellFormed(ws); err != nil {121 t.Error(err)122 }123}124func TestPriorityAdjustOwnParent(t *testing.T) {125 // Assigning a node as its own parent should have no effect.126 ws := defaultPriorityWriteScheduler()127 ws.OpenStream(1, OpenStreamOptions{})128 ws.OpenStream(2, OpenStreamOptions{})129 ws.AdjustStream(2, PriorityParam{130 StreamDep: 2,131 Weight: 20,132 Exclusive: true,133 })134 want := "1{weight:15,parent:0} 2{weight:15,parent:0}"135 if got := fmtTree(ws, fmtNodeWeightParentSkipRoot); got != want {136 t.Errorf("After adjust\ngot %q\nwant %q", got, want)137 }138 if err := checkPriorityWellFormed(ws); err != nil {139 t.Error(err)140 }141}142func TestPriorityClosedStreams(t *testing.T) {143 ws := NewPriorityWriteScheduler(&PriorityWriteSchedulerConfig{MaxClosedNodesInTree: 2}).(*priorityWriteScheduler)144 ws.OpenStream(1, OpenStreamOptions{})145 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})146 ws.OpenStream(3, OpenStreamOptions{PusherID: 2})147 ws.OpenStream(4, OpenStreamOptions{PusherID: 3})148 // Close the first three streams. We lose 1, but keep 2 and 3.149 ws.CloseStream(1)150 ws.CloseStream(2)151 ws.CloseStream(3)152 want := "2{weight:15,parent:0} 3{weight:15,parent:2} 4{weight:15,parent:3}"153 if got := fmtTree(ws, fmtNodeWeightParentSkipRoot); got != want {154 t.Errorf("After close\ngot %q\nwant %q", got, want)155 }156 if err := checkPriorityWellFormed(ws); err != nil {157 t.Error(err)158 }159 // Adding a stream as an exclusive child of 1 gives it default160 // priorities, since 1 is gone.161 ws.OpenStream(5, OpenStreamOptions{})162 ws.AdjustStream(5, PriorityParam{StreamDep: 1, Weight: 15, Exclusive: true})163 // Adding a stream as an exclusive child of 2 should work, since 2 is not gone.164 ws.OpenStream(6, OpenStreamOptions{})165 ws.AdjustStream(6, PriorityParam{StreamDep: 2, Weight: 15, Exclusive: true})166 want = "2{weight:15,parent:0} 3{weight:15,parent:6} 4{weight:15,parent:3} 5{weight:15,parent:0} 6{weight:15,parent:2}"167 if got := fmtTree(ws, fmtNodeWeightParentSkipRoot); got != want {168 t.Errorf("After add streams\ngot %q\nwant %q", got, want)169 }170 if err := checkPriorityWellFormed(ws); err != nil {171 t.Error(err)172 }173}174func TestPriorityClosedStreamsDisabled(t *testing.T) {175 ws := NewPriorityWriteScheduler(&PriorityWriteSchedulerConfig{}).(*priorityWriteScheduler)176 ws.OpenStream(1, OpenStreamOptions{})177 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})178 ws.OpenStream(3, OpenStreamOptions{PusherID: 2})179 // Close the first two streams. We keep only 3.180 ws.CloseStream(1)181 ws.CloseStream(2)182 want := "3{weight:15,parent:0}"183 if got := fmtTree(ws, fmtNodeWeightParentSkipRoot); got != want {184 t.Errorf("After close\ngot %q\nwant %q", got, want)185 }186 if err := checkPriorityWellFormed(ws); err != nil {187 t.Error(err)188 }189}190func TestPriorityIdleStreams(t *testing.T) {191 ws := NewPriorityWriteScheduler(&PriorityWriteSchedulerConfig{MaxIdleNodesInTree: 2}).(*priorityWriteScheduler)192 ws.AdjustStream(1, PriorityParam{StreamDep: 0, Weight: 15}) // idle193 ws.AdjustStream(2, PriorityParam{StreamDep: 0, Weight: 15}) // idle194 ws.AdjustStream(3, PriorityParam{StreamDep: 2, Weight: 20}) // idle195 ws.OpenStream(4, OpenStreamOptions{})196 ws.OpenStream(5, OpenStreamOptions{})197 ws.OpenStream(6, OpenStreamOptions{})198 ws.AdjustStream(4, PriorityParam{StreamDep: 1, Weight: 15})199 ws.AdjustStream(5, PriorityParam{StreamDep: 2, Weight: 15})200 ws.AdjustStream(6, PriorityParam{StreamDep: 3, Weight: 15})201 want := "2{weight:15,parent:0} 3{weight:20,parent:2} 4{weight:15,parent:0} 5{weight:15,parent:2} 6{weight:15,parent:3}"202 if got := fmtTree(ws, fmtNodeWeightParentSkipRoot); got != want {203 t.Errorf("After open\ngot %q\nwant %q", got, want)204 }205 if err := checkPriorityWellFormed(ws); err != nil {206 t.Error(err)207 }208}209func TestPriorityIdleStreamsDisabled(t *testing.T) {210 ws := NewPriorityWriteScheduler(&PriorityWriteSchedulerConfig{}).(*priorityWriteScheduler)211 ws.AdjustStream(1, PriorityParam{StreamDep: 0, Weight: 15}) // idle212 ws.AdjustStream(2, PriorityParam{StreamDep: 0, Weight: 15}) // idle213 ws.AdjustStream(3, PriorityParam{StreamDep: 2, Weight: 20}) // idle214 ws.OpenStream(4, OpenStreamOptions{})215 want := "4{weight:15,parent:0}"216 if got := fmtTree(ws, fmtNodeWeightParentSkipRoot); got != want {217 t.Errorf("After open\ngot %q\nwant %q", got, want)218 }219 if err := checkPriorityWellFormed(ws); err != nil {220 t.Error(err)221 }222}223func TestPrioritySection531NonExclusive(t *testing.T) {224 // Example from RFC 7540 Section 5.3.1.225 // A,B,C,D = 1,2,3,4226 ws := defaultPriorityWriteScheduler()227 ws.OpenStream(1, OpenStreamOptions{})228 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})229 ws.OpenStream(3, OpenStreamOptions{PusherID: 1})230 ws.OpenStream(4, OpenStreamOptions{})231 ws.AdjustStream(4, PriorityParam{232 StreamDep: 1,233 Weight: 15,234 Exclusive: false,235 })236 want := "1{parent:0} 2{parent:1} 3{parent:1} 4{parent:1}"237 if got := fmtTree(ws, fmtNodeParentSkipRoot); got != want {238 t.Errorf("After adjust\ngot %q\nwant %q", got, want)239 }240 if err := checkPriorityWellFormed(ws); err != nil {241 t.Error(err)242 }243}244func TestPrioritySection531Exclusive(t *testing.T) {245 // Example from RFC 7540 Section 5.3.1.246 // A,B,C,D = 1,2,3,4247 ws := defaultPriorityWriteScheduler()248 ws.OpenStream(1, OpenStreamOptions{})249 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})250 ws.OpenStream(3, OpenStreamOptions{PusherID: 1})251 ws.OpenStream(4, OpenStreamOptions{})252 ws.AdjustStream(4, PriorityParam{253 StreamDep: 1,254 Weight: 15,255 Exclusive: true,256 })257 want := "1{parent:0} 2{parent:4} 3{parent:4} 4{parent:1}"258 if got := fmtTree(ws, fmtNodeParentSkipRoot); got != want {259 t.Errorf("After adjust\ngot %q\nwant %q", got, want)260 }261 if err := checkPriorityWellFormed(ws); err != nil {262 t.Error(err)263 }264}265func makeSection533Tree() *priorityWriteScheduler {266 // Initial tree from RFC 7540 Section 5.3.3.267 // A,B,C,D,E,F = 1,2,3,4,5,6268 ws := defaultPriorityWriteScheduler()269 ws.OpenStream(1, OpenStreamOptions{})270 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})271 ws.OpenStream(3, OpenStreamOptions{PusherID: 1})272 ws.OpenStream(4, OpenStreamOptions{PusherID: 3})273 ws.OpenStream(5, OpenStreamOptions{PusherID: 3})274 ws.OpenStream(6, OpenStreamOptions{PusherID: 4})275 return ws276}277func TestPrioritySection533NonExclusive(t *testing.T) {278 // Example from RFC 7540 Section 5.3.3.279 // A,B,C,D,E,F = 1,2,3,4,5,6280 ws := defaultPriorityWriteScheduler()281 ws.OpenStream(1, OpenStreamOptions{})282 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})283 ws.OpenStream(3, OpenStreamOptions{PusherID: 1})284 ws.OpenStream(4, OpenStreamOptions{PusherID: 3})285 ws.OpenStream(5, OpenStreamOptions{PusherID: 3})286 ws.OpenStream(6, OpenStreamOptions{PusherID: 4})287 ws.AdjustStream(1, PriorityParam{288 StreamDep: 4,289 Weight: 15,290 Exclusive: false,291 })292 want := "1{parent:4} 2{parent:1} 3{parent:1} 4{parent:0} 5{parent:3} 6{parent:4}"293 if got := fmtTree(ws, fmtNodeParentSkipRoot); got != want {294 t.Errorf("After adjust\ngot %q\nwant %q", got, want)295 }296 if err := checkPriorityWellFormed(ws); err != nil {297 t.Error(err)298 }299}300func TestPrioritySection533Exclusive(t *testing.T) {301 // Example from RFC 7540 Section 5.3.3.302 // A,B,C,D,E,F = 1,2,3,4,5,6303 ws := defaultPriorityWriteScheduler()304 ws.OpenStream(1, OpenStreamOptions{})305 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})306 ws.OpenStream(3, OpenStreamOptions{PusherID: 1})307 ws.OpenStream(4, OpenStreamOptions{PusherID: 3})308 ws.OpenStream(5, OpenStreamOptions{PusherID: 3})309 ws.OpenStream(6, OpenStreamOptions{PusherID: 4})310 ws.AdjustStream(1, PriorityParam{311 StreamDep: 4,312 Weight: 15,313 Exclusive: true,314 })315 want := "1{parent:4} 2{parent:1} 3{parent:1} 4{parent:0} 5{parent:3} 6{parent:1}"316 if got := fmtTree(ws, fmtNodeParentSkipRoot); got != want {317 t.Errorf("After adjust\ngot %q\nwant %q", got, want)318 }319 if err := checkPriorityWellFormed(ws); err != nil {320 t.Error(err)321 }322}323func checkPopAll(ws WriteScheduler, order []uint32) error {324 for k, id := range order {325 wr, ok := ws.Pop()326 if !ok {327 return fmt.Errorf("Pop[%d]: got ok=false, want %d (order=%v)", k, id, order)328 }329 if got := wr.StreamID(); got != id {330 return fmt.Errorf("Pop[%d]: got %v, want %d (order=%v)", k, got, id, order)331 }332 }333 wr, ok := ws.Pop()334 if ok {335 return fmt.Errorf("Pop[%d]: got %v, want ok=false (order=%v)", len(order), wr.StreamID(), order)336 }337 return nil338}339func TestPriorityPopFrom533Tree(t *testing.T) {340 ws := makeSection533Tree()341 ws.Push(makeWriteHeadersRequest(3 /*C*/))342 ws.Push(makeWriteNonStreamRequest())343 ws.Push(makeWriteHeadersRequest(5 /*E*/))344 ws.Push(makeWriteHeadersRequest(1 /*A*/))345 t.Log("tree:", fmtTree(ws, fmtNodeParentSkipRoot))346 if err := checkPopAll(ws, []uint32{0 /*NonStream*/, 1, 3, 5}); err != nil {347 t.Error(err)348 }349}350func TestPriorityPopFromLinearTree(t *testing.T) {351 ws := defaultPriorityWriteScheduler()352 ws.OpenStream(1, OpenStreamOptions{})353 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})354 ws.OpenStream(3, OpenStreamOptions{PusherID: 2})355 ws.OpenStream(4, OpenStreamOptions{PusherID: 3})356 ws.Push(makeWriteHeadersRequest(3))357 ws.Push(makeWriteHeadersRequest(4))358 ws.Push(makeWriteHeadersRequest(1))359 ws.Push(makeWriteHeadersRequest(2))360 ws.Push(makeWriteNonStreamRequest())361 ws.Push(makeWriteNonStreamRequest())362 t.Log("tree:", fmtTree(ws, fmtNodeParentSkipRoot))363 if err := checkPopAll(ws, []uint32{0, 0 /*NonStreams*/, 1, 2, 3, 4}); err != nil {364 t.Error(err)365 }366}367func TestPriorityFlowControl(t *testing.T) {368 ws := NewPriorityWriteScheduler(&PriorityWriteSchedulerConfig{ThrottleOutOfOrderWrites: false})369 ws.OpenStream(1, OpenStreamOptions{})370 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})371 sc := &serverConn{maxFrameSize: 16}372 st1 := &stream{id: 1, sc: sc}373 st2 := &stream{id: 2, sc: sc}374 ws.Push(FrameWriteRequest{&writeData{1, make([]byte, 16), false}, st1, nil})375 ws.Push(FrameWriteRequest{&writeData{2, make([]byte, 16), false}, st2, nil})376 ws.AdjustStream(2, PriorityParam{StreamDep: 1})377 // No flow-control bytes available.378 if wr, ok := ws.Pop(); ok {379 t.Fatalf("Pop(limited by flow control)=%v,true, want false", wr)380 }381 // Add enough flow-control bytes to write st2 in two Pop calls.382 // Should write data from st2 even though it's lower priority than st1.383 for i := 1; i <= 2; i++ {384 st2.flow.add(8)385 wr, ok := ws.Pop()386 if !ok {387 t.Fatalf("Pop(%d)=false, want true", i)388 }389 if got, want := wr.DataSize(), 8; got != want {390 t.Fatalf("Pop(%d)=%d bytes, want %d bytes", i, got, want)391 }392 }393}394func TestPriorityThrottleOutOfOrderWrites(t *testing.T) {395 ws := NewPriorityWriteScheduler(&PriorityWriteSchedulerConfig{ThrottleOutOfOrderWrites: true})396 ws.OpenStream(1, OpenStreamOptions{})397 ws.OpenStream(2, OpenStreamOptions{PusherID: 1})398 sc := &serverConn{maxFrameSize: 4096}399 st1 := &stream{id: 1, sc: sc}400 st2 := &stream{id: 2, sc: sc}401 st1.flow.add(4096)402 st2.flow.add(4096)403 ws.Push(FrameWriteRequest{&writeData{2, make([]byte, 4096), false}, st2, nil})404 ws.AdjustStream(2, PriorityParam{StreamDep: 1})405 // We have enough flow-control bytes to write st2 in a single Pop call.406 // However, due to out-of-order write throttling, the first call should407 // only write 1KB.408 wr, ok := ws.Pop()409 if !ok {410 t.Fatalf("Pop(st2.first)=false, want true")411 }412 if got, want := wr.StreamID(), uint32(2); got != want {413 t.Fatalf("Pop(st2.first)=stream %d, want stream %d", got, want)414 }415 if got, want := wr.DataSize(), 1024; got != want {416 t.Fatalf("Pop(st2.first)=%d bytes, want %d bytes", got, want)417 }418 // Now add data on st1. This should take precedence.419 ws.Push(FrameWriteRequest{&writeData{1, make([]byte, 4096), false}, st1, nil})420 wr, ok = ws.Pop()421 if !ok {422 t.Fatalf("Pop(st1)=false, want true")423 }424 if got, want := wr.StreamID(), uint32(1); got != want {425 t.Fatalf("Pop(st1)=stream %d, want stream %d", got, want)426 }427 if got, want := wr.DataSize(), 4096; got != want {428 t.Fatalf("Pop(st1)=%d bytes, want %d bytes", got, want)429 }430 // Should go back to writing 1KB from st2.431 wr, ok = ws.Pop()432 if !ok {433 t.Fatalf("Pop(st2.last)=false, want true")434 }435 if got, want := wr.StreamID(), uint32(2); got != want {436 t.Fatalf("Pop(st2.last)=stream %d, want stream %d", got, want)437 }438 if got, want := wr.DataSize(), 1024; got != want {439 t.Fatalf("Pop(st2.last)=%d bytes, want %d bytes", got, want)440 }441}442func TestPriorityWeights(t *testing.T) {443 ws := defaultPriorityWriteScheduler()444 ws.OpenStream(1, OpenStreamOptions{})445 ws.OpenStream(2, OpenStreamOptions{})446 sc := &serverConn{maxFrameSize: 8}447 st1 := &stream{id: 1, sc: sc}448 st2 := &stream{id: 2, sc: sc}449 st1.flow.add(40)450 st2.flow.add(40)451 ws.Push(FrameWriteRequest{&writeData{1, make([]byte, 40), false}, st1, nil})452 ws.Push(FrameWriteRequest{&writeData{2, make([]byte, 40), false}, st2, nil})453 ws.AdjustStream(1, PriorityParam{StreamDep: 0, Weight: 34})454 ws.AdjustStream(2, PriorityParam{StreamDep: 0, Weight: 9})455 // st1 gets 3.5x the bandwidth of st2 (3.5 = (34+1)/(9+1)).456 // The maximum frame size is 8 bytes. The write sequence should be:457 // st1, total bytes so far is (st1=8, st=0)458 // st2, total bytes so far is (st1=8, st=8)459 // st1, total bytes so far is (st1=16, st=8)460 // st1, total bytes so far is (st1=24, st=8) // 3x bandwidth461 // st1, total bytes so far is (st1=32, st=8) // 4x bandwidth462 // st2, total bytes so far is (st1=32, st=16) // 2x bandwidth463 // st1, total bytes so far is (st1=40, st=16)464 // st2, total bytes so far is (st1=40, st=24)465 // st2, total bytes so far is (st1=40, st=32)466 // st2, total bytes so far is (st1=40, st=40)467 if err := checkPopAll(ws, []uint32{1, 2, 1, 1, 1, 2, 1, 2, 2, 2}); err != nil {468 t.Error(err)469 }470}471func TestPriorityRstStreamOnNonOpenStreams(t *testing.T) {472 ws := NewPriorityWriteScheduler(&PriorityWriteSchedulerConfig{473 MaxClosedNodesInTree: 0,474 MaxIdleNodesInTree: 0,475 })476 ws.OpenStream(1, OpenStreamOptions{})477 ws.CloseStream(1)478 ws.Push(FrameWriteRequest{write: streamError(1, ErrCodeProtocol)})479 ws.Push(FrameWriteRequest{write: streamError(2, ErrCodeProtocol)})480 if err := checkPopAll(ws, []uint32{1, 2}); err != nil {481 t.Error(err)482 }483}...

Full Screen

Full Screen

FilterTest.php

Source:FilterTest.php Github

copy

Full Screen

...3class FilterTest extends PHPUnit_Framework_TestCase4{5 public function testAppendSimpleCallback()6 {7 $stream = $this->createStream();8 StreamFilter\append($stream, function ($chunk) {9 return strtoupper($chunk);10 });11 fwrite($stream, 'hello');12 fwrite($stream, 'world');13 rewind($stream);14 $this->assertEquals('HELLOWORLD', stream_get_contents($stream));15 fclose($stream);16 }17 public function testAppendNativePhpFunction()18 {19 $stream = $this->createStream();20 StreamFilter\append($stream, 'strtoupper');21 fwrite($stream, 'hello');22 fwrite($stream, 'world');23 rewind($stream);24 $this->assertEquals('HELLOWORLD', stream_get_contents($stream));25 fclose($stream);26 }27 public function testAppendChangingChunkSize()28 {29 $stream = $this->createStream();30 StreamFilter\append($stream, function ($chunk) {31 return str_replace(array('a','e','i','o','u'), '', $chunk);32 });33 fwrite($stream, 'hello');34 fwrite($stream, 'world');35 rewind($stream);36 $this->assertEquals('hllwrld', stream_get_contents($stream));37 fclose($stream);38 }39 public function testAppendReturningEmptyStringWillNotPassThrough()40 {41 $stream = $this->createStream();42 StreamFilter\append($stream, function ($chunk) {43 return '';44 });45 fwrite($stream, 'hello');46 fwrite($stream, 'world');47 rewind($stream);48 $this->assertEquals('', stream_get_contents($stream));49 fclose($stream);50 }51 public function testAppendEndEventCanBeBufferedOnClose()52 {53 if (PHP_VERSION < 5.4) $this->markTestSkipped('Not supported on legacy PHP');54 $stream = $this->createStream();55 StreamFilter\append($stream, function ($chunk = null) {56 if ($chunk === null) {57 // this signals the end event58 return '!';59 }60 return $chunk . ' ';61 }, STREAM_FILTER_WRITE);62 $buffered = '';63 StreamFilter\append($stream, function ($chunk) use (&$buffered) {64 $buffered .= $chunk;65 return '';66 });67 fwrite($stream, 'hello');68 fwrite($stream, 'world');69 fclose($stream);70 $this->assertEquals('hello world !', $buffered);71 }72 public function testAppendEndEventWillBeCalledOnRemove()73 {74 $stream = $this->createStream();75 $ended = false;76 $filter = StreamFilter\append($stream, function ($chunk = null) use (&$ended) {77 if ($chunk === null) {78 $ended = true;79 }80 return $chunk;81 }, STREAM_FILTER_WRITE);82 $this->assertEquals(0, $ended);83 StreamFilter\remove($filter);84 $this->assertEquals(1, $ended);85 }86 public function testAppendEndEventWillBeCalledOnClose()87 {88 $stream = $this->createStream();89 $ended = false;90 StreamFilter\append($stream, function ($chunk = null) use (&$ended) {91 if ($chunk === null) {92 $ended = true;93 }94 return $chunk;95 }, STREAM_FILTER_WRITE);96 $this->assertEquals(0, $ended);97 fclose($stream);98 $this->assertEquals(1, $ended);99 }100 public function testAppendWriteOnly()101 {102 $stream = $this->createStream();103 $invoked = 0;104 StreamFilter\append($stream, function ($chunk) use (&$invoked) {105 ++$invoked;106 return $chunk;107 }, STREAM_FILTER_WRITE);108 fwrite($stream, 'a');109 fwrite($stream, 'b');110 fwrite($stream, 'c');111 rewind($stream);112 $this->assertEquals(3, $invoked);113 $this->assertEquals('abc', stream_get_contents($stream));114 fclose($stream);115 }116 public function testAppendReadOnly()117 {118 $stream = $this->createStream();119 $invoked = 0;120 StreamFilter\append($stream, function ($chunk) use (&$invoked) {121 ++$invoked;122 return $chunk;123 }, STREAM_FILTER_READ);124 fwrite($stream, 'a');125 fwrite($stream, 'b');126 fwrite($stream, 'c');127 rewind($stream);128 $this->assertEquals(0, $invoked);129 $this->assertEquals('abc', stream_get_contents($stream));130 $this->assertEquals(1, $invoked);131 fclose($stream);132 }133 public function testOrderCallingAppendAfterPrepend()134 {135 $stream = $this->createStream();136 StreamFilter\append($stream, function ($chunk) {137 return '[' . $chunk . ']';138 }, STREAM_FILTER_WRITE);139 StreamFilter\prepend($stream, function ($chunk) {140 return '(' . $chunk . ')';141 }, STREAM_FILTER_WRITE);142 fwrite($stream, 'hello');143 rewind($stream);144 $this->assertEquals('[(hello)]', stream_get_contents($stream));145 fclose($stream);146 }147 public function testRemoveFilter()148 {149 $stream = $this->createStream();150 $first = StreamFilter\append($stream, function ($chunk) {151 return $chunk . '?';152 }, STREAM_FILTER_WRITE);153 StreamFilter\append($stream, function ($chunk) {154 return $chunk . '!';155 }, STREAM_FILTER_WRITE);156 StreamFilter\remove($first);157 fwrite($stream, 'hello');158 rewind($stream);159 $this->assertEquals('hello!', stream_get_contents($stream));160 fclose($stream);161 }162 public function testAppendFunDechunk()163 {164 if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (dechunk filter does not exist)');165 $stream = $this->createStream();166 StreamFilter\append($stream, StreamFilter\fun('dechunk'), STREAM_FILTER_WRITE);167 fwrite($stream, "2\r\nhe\r\n");168 fwrite($stream, "3\r\nllo\r\n");169 fwrite($stream, "0\r\n\r\n");170 rewind($stream);171 $this->assertEquals('hello', stream_get_contents($stream));172 fclose($stream);173 }174 public function testAppendThrows()175 {176 $this->createErrorHandler($errors);177 $stream = $this->createStream();178 $this->createErrorHandler($errors);179 StreamFilter\append($stream, function ($chunk) {180 throw new \DomainException($chunk);181 });182 fwrite($stream, 'test');183 $this->removeErrorHandler();184 $this->assertCount(1, $errors);185 $this->assertContains('test', $errors[0]);186 }187 public function testAppendThrowsDuringEnd()188 {189 $stream = $this->createStream();190 $this->createErrorHandler($errors);191 StreamFilter\append($stream, function ($chunk = null) {192 if ($chunk === null) {193 throw new \DomainException('end');194 }195 return $chunk;196 });197 fclose($stream);198 $this->removeErrorHandler();199 // We can only assert we're not seeing an exception here…200 // * php 5.3-5.6 sees one error here201 // * php 7 does not see any error here202 // * hhvm sees the same error twice203 //204 // If you're curious:205 //206 // var_dump($errors);207 // $this->assertCount(1, $errors);208 // $this->assertContains('end', $errors[0]);209 }210 public function testAppendThrowsShouldTriggerEnd()211 {212 $stream = $this->createStream();213 $this->createErrorHandler($errors);214 $ended = false;215 StreamFilter\append($stream, function ($chunk = null) use (&$ended) {216 if ($chunk === null) {217 $ended = true;218 return '';219 }220 throw new \DomainException($chunk);221 });222 $this->assertEquals(false, $ended);223 fwrite($stream, 'test');224 $this->assertEquals(true, $ended);225 $this->removeErrorHandler();226 $this->assertCount(1, $errors);227 $this->assertContains('test', $errors[0]);228 }229 public function testAppendThrowsShouldTriggerEndButIgnoreExceptionDuringEnd()230 {231 //$this->markTestIncomplete();232 $stream = $this->createStream();233 $this->createErrorHandler($errors);234 StreamFilter\append($stream, function ($chunk = null) {235 if ($chunk === null) {236 $chunk = 'end';237 //return '';238 }239 throw new \DomainException($chunk);240 });241 fwrite($stream, 'test');242 $this->removeErrorHandler();243 $this->assertCount(1, $errors);244 $this->assertContains('test', $errors[0]);245 }246 /**247 * @expectedException RuntimeException248 */249 public function testAppendInvalidStreamIsRuntimeError()250 {251 if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (does not reject invalid stream)');252 StreamFilter\append(false, function () { });253 }254 /**255 * @expectedException RuntimeException256 */257 public function testPrependInvalidStreamIsRuntimeError()258 {259 if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (does not reject invalid stream)');260 StreamFilter\prepend(false, function () { });261 }262 /**263 * @expectedException RuntimeException264 */265 public function testRemoveInvalidFilterIsRuntimeError()266 {267 if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (does not reject invalid filters)');268 StreamFilter\remove(false);269 }270 /**271 * @expectedException InvalidArgumentException272 */273 public function testInvalidCallbackIsInvalidArgument()274 {275 $stream = $this->createStream();276 StreamFilter\append($stream, 'a-b-c');277 }278 private function createStream()279 {280 return fopen('php://memory', 'r+');281 }282 private function createErrorHandler(&$errors)283 {284 $errors = array();285 set_error_handler(function ($_, $message) use (&$errors) {286 $errors []= $message;287 });288 }289 private function removeErrorHandler()290 {...

Full Screen

Full Screen

StreamWrapperSpec.php

Source:StreamWrapperSpec.php Github

copy

Full Screen

...9{10 /**11 * @param \Gaufrette\FilesystemMap $map12 * @param \Gaufrette\Filesystem $filesystem13 * @param \Gaufrette\Stream $stream14 */15 function let(FilesystemMap $map, Filesystem $filesystem, Stream $stream)16 {17 $filesystem->createStream('filename')->willReturn($stream);18 $map->get('some')->willReturn($filesystem);19 $this->setFilesystemMap($map);20 }21 function it_is_initializable()22 {23 $this->shouldHaveType('Gaufrette\StreamWrapper');24 }25 /**26 * @param \Gaufrette\Stream $stream27 */28 function it_opens_stream(Stream $stream)29 {30 $stream->open(Argument::any())->willReturn(true);31 $this->stream_open('gaufrette://some/filename', 'r+')->shouldReturn(true);32 }33 function it_does_not_open_stream_when_key_is_not_defined()34 {35 $this36 ->shouldThrow(new \InvalidArgumentException('The specified path (gaufrette://some) is invalid.'))37 ->duringStream_open('gaufrette://some', 'r+');38 }39 function it_does_not_open_stream_when_host_is_not_defined()40 {41 $this42 ->shouldThrow(new \InvalidArgumentException('The specified path (gaufrette:///somefile) is invalid.'))43 ->duringStream_open('gaufrette:///somefile', 'r+')44 ;45 }46 function it_does_not_read_from_stream_when_is_not_opened()47 {48 $this->stream_read(10)->shouldReturn(false);49 }50 /**51 * @param \Gaufrette\Stream $stream52 */53 function it_does_not_read_from_stream(Stream $stream)54 {55 $stream->open(Argument::any())->willReturn(true);56 $stream->read(4)->willReturn('some');57 $this->stream_open('gaufrette://some/filename', 'r+');58 $this->stream_read(4)->shouldReturn('some');59 }60 function it_does_not_write_to_stream_when_is_not_opened()61 {62 $this->stream_write('some content')->shouldReturn(0);63 }64 /**65 * @param \Gaufrette\Stream $stream66 */67 function it_writes_to_stream(Stream $stream)68 {69 $stream->open(Argument::any())->willReturn(true);70 $stream->write('some content')->shouldBeCalled()->willReturn(12);71 $this->stream_open('gaufrette://some/filename', 'w+');72 $this->stream_write('some content')->shouldReturn(12);73 }74 /**75 * @param \Gaufrette\Stream $stream76 */77 function it_does_not_close_stream_when_is_not_opened($stream)78 {79 $stream->close()->shouldNotBeCalled();80 $this->stream_close();81 }82 /**83 * @param \Gaufrette\Stream $stream84 */85 function it_closes_stream(Stream $stream)86 {87 $stream->open(Argument::any())->willReturn(true);88 $stream->close()->shouldBeCalled();89 $this->stream_open('gaufrette://some/filename', 'w+');90 $this->stream_close();91 }92 /**93 * @param \Gaufrette\Stream $stream94 */95 function it_does_not_flush_stream_when_is_not_opened(Stream $stream)96 {97 $stream->flush()->shouldNotBeCalled();98 $this->stream_flush();99 }100 /**101 * @param \Gaufrette\Stream $stream102 */103 function it_flushes_stream(Stream $stream)104 {105 $stream->open(Argument::any())->willReturn(true);106 $stream->flush()->shouldBeCalled();107 $this->stream_open('gaufrette://some/filename', 'w+');108 $this->stream_flush();109 }110 /**111 * @param \Gaufrette\Stream $stream112 */113 function it_does_not_seek_in_stream_when_is_not_opened(Stream $stream)114 {115 $stream->seek(12, SEEK_SET)->shouldNotBeCalled();116 $this->stream_seek(12, SEEK_SET);117 }118 /**119 * @param \Gaufrette\Stream $stream120 */121 function it_seeks_in_stream(Stream $stream)122 {123 $stream->open(Argument::any())->willReturn(true);124 $stream->seek(12, SEEK_SET)->shouldBeCalled()->willReturn(true);125 $this->stream_open('gaufrette://some/filename', 'w+');126 $this->stream_seek(12, SEEK_SET)->shouldReturn(true);127 }128 /**129 * @param \Gaufrette\Stream $stream130 */131 function it_does_not_tell_about_position_in_stream_when_is_not_opened(Stream $stream)132 {133 $stream->tell()->shouldNotBeCalled();134 $this->stream_tell();135 }136 /**137 * @param \Gaufrette\Stream $stream138 */139 function it_does_tell_about_position_in_stream(Stream $stream)140 {141 $stream->open(Argument::any())->willReturn(true);142 $stream->tell()->shouldBeCalled()->willReturn(12);143 $this->stream_open('gaufrette://some/filename', 'w+');144 $this->stream_tell()->shouldReturn(12);145 }146 /**147 * @param \Gaufrette\Stream $stream148 */149 function it_does_not_mark_as_eof_if_stream_is_not_opened(Stream $stream)150 {151 $stream->eof()->shouldNotBeCalled();152 $this->stream_eof();153 }154 /**155 * @param \Gaufrette\Stream $stream156 */157 function it_checks_if_eof(Stream $stream)158 {159 $stream->open(Argument::any())->willReturn(true);160 $this->stream_open('gaufrette://some/filename', 'w+');161 $stream->eof()->willReturn(false);162 $this->stream_eof()->shouldReturn(false);163 $stream->eof()->willReturn(true);164 $this->stream_eof()->shouldReturn(true);165 }166 function it_does_not_get_stat_when_is_not_open()167 {168 $this->stream_stat()->shouldReturn(false);169 }170 /**171 * @param \Gaufrette\Stream $stream172 */173 function it_stats_file(Stream $stream)174 {175 $stat = array(176 'dev' => 1,177 'ino' => 12,178 'mode' => 0777,179 'nlink' => 0,180 'uid' => 123,181 'gid' => 1,182 'rdev' => 0,183 'size' => 666,184 'atime' => 1348030800,185 'mtime' => 1348030800,186 'ctime' => 1348030800,187 'blksize' => 5,188 'blocks' => 1,189 );190 $stream->open(Argument::any())->willReturn(true);191 $stream->stat()->willReturn($stat);192 $this->stream_open('gaufrette://some/filename', 'w+');193 $this->stream_stat()->shouldReturn($stat);194 }195 /**196 * @param \Gaufrette\Stream $stream197 */198 function it_should_stat_from_url(Stream $stream)199 {200 $stat = array(201 'dev' => 1,202 'ino' => 12,203 'mode' => 0777,204 'nlink' => 0,205 'uid' => 123,206 'gid' => 1,207 'rdev' => 0,208 'size' => 666,209 'atime' => 1348030800,210 'mtime' => 1348030800,211 'ctime' => 1348030800,212 'blksize' => 5,213 'blocks' => 1,214 );215 $stream->open(Argument::any())->willReturn(true);216 $stream->stat()->willReturn($stat);217 $this->url_stat('gaufrette://some/filename', STREAM_URL_STAT_LINK)->shouldReturn($stat);218 }219 /**220 * @param \Gaufrette\Filesystem $stream221 * @param \Gaufrette\Stream $stream222 */223 function it_stats_even_if_it_cannot_be_open(Filesystem $filesystem, Stream $stream)224 {225 $filesystem->createStream('dir/')->willReturn($stream);226 $stream->open(Argument::any())->willThrow(new \RuntimeException);227 $stream->stat(Argument::any())->willReturn(array('mode' => 16893));228 $this->url_stat('gaufrette://some/dir/', STREAM_URL_STAT_LINK)->shouldReturn(array('mode' => 16893));229 }230 /**231 * @param \Gaufrette\Stream $stream232 */233 function it_does_not_unlink_when_cannot_open(Stream $stream)234 {235 $stream->open(Argument::any())->willThrow(new \RuntimeException);236 $this->unlink('gaufrette://some/filename')->shouldReturn(false);237 }238 /**239 * @param \Gaufrette\Stream $stream240 */241 function it_unlinks_file(Stream $stream)242 {243 $stream->open(Argument::any())->willReturn(true);244 $stream->unlink()->willReturn(true);245 $this->unlink('gaufrette://some/filename')->shouldReturn(true);246 }247 function it_does_not_cast_stream_if_is_not_opened()248 {249 $this->stream_cast(STREAM_CAST_FOR_SELECT)->shouldReturn(false);250 }251 /**252 * @param \Gaufrette\Stream $stream253 */254 function it_casts_stream(Stream $stream)255 {256 $stream->open(Argument::any())->willReturn(true);257 $stream->cast(STREAM_CAST_FOR_SELECT)->willReturn('resource');258 $this->stream_open('gaufrette://some/filename', 'w+');259 $this->stream_cast(STREAM_CAST_FOR_SELECT)->shouldReturn('resource');260 }261}...

Full Screen

Full Screen

writesched.go

Source:writesched.go Github

copy

Full Screen

...5import "fmt"6// WriteScheduler is the interface implemented by HTTP/2 write schedulers.7// Methods are never called concurrently.8type WriteScheduler interface {9 // OpenStream opens a new stream in the write scheduler.10 // It is illegal to call this with streamID=0 or with a streamID that is11 // already open -- the call may panic.12 OpenStream(streamID uint32, options OpenStreamOptions)13 // CloseStream closes a stream in the write scheduler. Any frames queued on14 // this stream should be discarded. It is illegal to call this on a stream15 // that is not open -- the call may panic.16 CloseStream(streamID uint32)17 // AdjustStream adjusts the priority of the given stream. This may be called18 // on a stream that has not yet been opened or has been closed. Note that19 // RFC 7540 allows PRIORITY frames to be sent on streams in any state. See:20 // https://tools.ietf.org/html/rfc7540#section-5.121 AdjustStream(streamID uint32, priority PriorityParam)22 // Push queues a frame in the scheduler. In most cases, this will not be23 // called with wr.StreamID()!=0 unless that stream is currently open. The one24 // exception is RST_STREAM frames, which may be sent on idle or closed streams.25 Push(wr FrameWriteRequest)26 // Pop dequeues the next frame to write. Returns false if no frames can27 // be written. Frames with a given wr.StreamID() are Pop'd in the same28 // order they are Push'd. No frames should be discarded except by CloseStream.29 Pop() (wr FrameWriteRequest, ok bool)30}31// OpenStreamOptions specifies extra options for WriteScheduler.OpenStream.32type OpenStreamOptions struct {33 // PusherID is zero if the stream was initiated by the client. Otherwise,34 // PusherID names the stream that pushed the newly opened stream.35 PusherID uint3236}37// FrameWriteRequest is a request to write a frame.38type FrameWriteRequest struct {39 // write is the interface value that does the writing, once the40 // WriteScheduler has selected this frame to write. The write41 // functions are all defined in write.go.42 write writeFramer43 // stream is the stream on which this frame will be written.44 // nil for non-stream frames like PING and SETTINGS.45 stream *stream46 // done, if non-nil, must be a buffered channel with space for47 // 1 message and is sent the return value from write (or an48 // earlier error) when the frame has been written.49 done chan error50}51// StreamID returns the id of the stream this frame will be written to.52// 0 is used for non-stream frames such as PING and SETTINGS.53func (wr FrameWriteRequest) StreamID() uint32 {54 if wr.stream == nil {55 if se, ok := wr.write.(StreamError); ok {56 // (*serverConn).resetStream doesn't set57 // stream because it doesn't necessarily have58 // one. So special case this type of write59 // message.60 return se.StreamID61 }62 return 063 }64 return wr.stream.id65}66// isControl reports whether wr is a control frame for MaxQueuedControlFrames67// purposes. That includes non-stream frames and RST_STREAM frames.68func (wr FrameWriteRequest) isControl() bool {69 return wr.stream == nil70}71// DataSize returns the number of flow control bytes that must be consumed72// to write this entire frame. This is 0 for non-DATA frames.73func (wr FrameWriteRequest) DataSize() int {74 if wd, ok := wr.write.(*writeData); ok {75 return len(wd.p)76 }77 return 078}79// Consume consumes min(n, available) bytes from this frame, where available80// is the number of flow control bytes available on the stream. Consume returns81// 0, 1, or 2 frames, where the integer return value gives the number of frames82// returned.83//84// If flow control prevents consuming any bytes, this returns (_, _, 0). If85// the entire frame was consumed, this returns (wr, _, 1). Otherwise, this86// returns (consumed, rest, 2), where 'consumed' contains the consumed bytes and87// 'rest' contains the remaining bytes. The consumed bytes are deducted from the88// underlying stream's flow control budget.89func (wr FrameWriteRequest) Consume(n int32) (FrameWriteRequest, FrameWriteRequest, int) {90 var empty FrameWriteRequest91 // Non-DATA frames are always consumed whole.92 wd, ok := wr.write.(*writeData)93 if !ok || len(wd.p) == 0 {94 return wr, empty, 195 }96 // Might need to split after applying limits.97 allowed := wr.stream.flow.available()98 if n < allowed {99 allowed = n100 }101 if wr.stream.sc.maxFrameSize < allowed {102 allowed = wr.stream.sc.maxFrameSize103 }104 if allowed <= 0 {105 return empty, empty, 0106 }107 if len(wd.p) > int(allowed) {108 wr.stream.flow.take(allowed)109 consumed := FrameWriteRequest{110 stream: wr.stream,111 write: &writeData{112 streamID: wd.streamID,113 p: wd.p[:allowed],114 // Even if the original had endStream set, there115 // are bytes remaining because len(wd.p) > allowed,116 // so we know endStream is false.117 endStream: false,118 },119 // Our caller is blocking on the final DATA frame, not120 // this intermediate frame, so no need to wait.121 done: nil,122 }123 rest := FrameWriteRequest{124 stream: wr.stream,125 write: &writeData{126 streamID: wd.streamID,127 p: wd.p[allowed:],128 endStream: wd.endStream,129 },130 done: wr.done,131 }132 return consumed, rest, 2133 }134 // The frame is consumed whole.135 // NB: This cast cannot overflow because allowed is <= math.MaxInt32.136 wr.stream.flow.take(int32(len(wd.p)))137 return wr, empty, 1138}139// String is for debugging only.140func (wr FrameWriteRequest) String() string {141 var des string142 if s, ok := wr.write.(fmt.Stringer); ok {143 des = s.String()144 } else {145 des = fmt.Sprintf("%T", wr.write)146 }147 return fmt.Sprintf("[FrameWriteRequest stream=%d, ch=%v, writer=%v]", wr.StreamID(), wr.done != nil, des)148}149// replyToWriter sends err to wr.done and panics if the send must block150// This does nothing if wr.done is nil.151func (wr *FrameWriteRequest) replyToWriter(err error) {152 if wr.done == nil {153 return154 }155 select {156 case wr.done <- err:157 default:158 panic(fmt.Sprintf("unbuffered done channel passed in for type %T", wr.write))159 }160 wr.write = nil // prevent use (assume it's tainted after wr.done send)161}...

Full Screen

Full Screen

ANTLRStringStreamTest.php

Source:ANTLRStringStreamTest.php Github

copy

Full Screen

...25 self::assertEquals(2,$ass->getCharPositionInLine());26 }27 public function testSize() {28 //ANTLRStringStream.size();29 $stream = new ANTLRStringStream('foo');30 self::assertEquals($stream->size(), 3);31 }32 public function testIndex() {33 //ANTLRStringStream.index();34 $stream = new ANTLRStringStream('foo');35 self::assertEquals($stream->index(), 0);36 }37 public function testConsume() {38 39 $stream = new ANTLRStringStream("foo\nbar");40 $stream->consume(); # f41 self::assertEquals($stream->index(), 1);42 self::assertEquals($stream->charPositionInLine, 1);43 self::assertEquals($stream->line, 1);44 $stream->consume(); # o45 self::assertEquals($stream->index(), 2);46 self::assertEquals($stream->charPositionInLine, 2);47 self::assertEquals($stream->line, 1);48 $stream->consume(); # o49 self::assertEquals($stream->index(), 3);50 self::assertEquals($stream->charPositionInLine, 3);51 self::assertEquals($stream->line, 1);52 $stream->consume(); # \n53 self::assertEquals($stream->index(), 4);54 self::assertEquals($stream->charPositionInLine, 0);55 self::assertEquals($stream->line, 2);56 $stream->consume(); # b57 self::assertEquals($stream->index(), 5);58 self::assertEquals($stream->charPositionInLine, 1);59 self::assertEquals($stream->line, 2);60 $stream->consume(); # a61 self::assertEquals($stream->index(), 6);62 self::assertEquals($stream->charPositionInLine, 2);63 self::assertEquals($stream->line, 2);64 $stream->consume(); # r65 self::assertEquals($stream->index(), 7);66 self::assertEquals($stream->charPositionInLine, 3);67 self::assertEquals($stream->line, 2);68 $stream->consume(); # EOF69 self::assertEquals($stream->index(), 7);70 self::assertEquals($stream->charPositionInLine, 3);71 self::assertEquals($stream->line, 2);72 $stream->consume(); # EOF73 self::assertEquals($stream->index(), 7);74 self::assertEquals($stream->charPositionInLine, 3);75 self::assertEquals($stream->line, 2);76 }77 public function testReset() {78 79 $stream = new ANTLRStringStream('foo');80 $stream->consume();81 $stream->consume();82 $stream->reset();83 self::assertEquals($stream->index(), 0);84 self::assertEquals($stream->line, 1);85 self::assertEquals($stream->charPositionInLine, 0);86 self::assertEquals(chr($stream->LT(1)), 'f');87 }88 public function testSubstring(){89 $stream = new ANTLRStringStream('foobar');90 91 self::assertEquals($stream->substring(0, 0), 'f');92 self::assertEquals($stream->substring(0, 1), 'fo');93 self::assertEquals($stream->substring(0, 5), 'foobar');94 self::assertEquals($stream->substring(3, 5), 'bar');95 }96 97 public function testSeekForward(){98 $stream = new ANTLRStringStream("foo\nbar");99 $stream->seek(4);100 101 self::assertEquals($stream->index(), 4);102 self::assertEquals($stream->line, 2);103 self::assertEquals($stream->charPositionInLine, 0);104 self::assertEquals(chr($stream->LT(1)), 'b');105 }106 public function testMark(){ 107 $stream = new ANTLRStringStream("foo\nbar");108 $stream->seek(4);109 110 $marker = $stream->mark();111 self::assertEquals($marker, 1);112 self::assertEquals($stream->markDepth, 1);113 $stream->consume();114 $marker = $stream->mark();115 self::assertEquals($marker, 2);116 self::assertEquals($stream->markDepth, 2);117 }118 119 public function testReleaseLast(){120 $stream = new ANTLRStringStream("foo\nbar");121 122 $stream->seek(4);123 $marker1 = $stream->mark();124 125 $stream->consume();126 $marker2 = $stream->mark();127 $stream->release();128 self::assertEquals($stream->markDepth, 1);129 # release same marker again, nothing has changed130 $stream->release();131 self::assertEquals($stream->markDepth, 1);132 } 133 public function testReleaseNested(){134 $stream = new ANTLRStringStream("foo\nbar");135 $stream->seek(4);136 $marker1 = $stream->mark();137 138 $stream->consume();139 $marker2 = $stream->mark();140 141 $stream->consume();142 $marker3 = $stream->mark();143 $stream->release($marker2);144 self::assertEquals($stream->markDepth, 1);145 }146 public function testRewindLast(){147 $stream = new ANTLRStringStream("foo\nbar");148 $stream->seek(4);149 $marker = $stream->mark();150 $stream->consume();151 $stream->consume();152 $stream->rewind();153 self::assertEquals($stream->markDepth, 0);154 self::assertEquals($stream->index(), 4);155 self::assertEquals($stream->line, 2);156 self::assertEquals($stream->charPositionInLine, 0);157 self::assertEquals(chr($stream->LT(1)), 'b');158 } 159 public function testRewindNested(){ 160 $stream = new ANTLRStringStream("foo\nbar");161 $stream->seek(4);162 $marker1 = $stream->mark();163 164 $stream->consume();165 $marker2 = $stream->mark();166 167 $stream->consume();168 $marker3 = $stream->mark();169 $stream->rewind($marker2);170 self::assertEquals($stream->markDepth, 1);171 self::assertEquals($stream->index(), 5);172 self::assertEquals($stream->line, 2);173 self::assertEquals($stream->charPositionInLine, 1);174 self::assertEquals(chr($stream->LT(1)), 'a');175 }176}177?>...

Full Screen

Full Screen

watcher_fsevents_cgo.go

Source:watcher_fsevents_cgo.go Github

copy

Full Screen

...6/*7#include <CoreServices/CoreServices.h>8typedef void (*CFRunLoopPerformCallBack)(void*);9void gosource(void *);10void gostream(uintptr_t, uintptr_t, size_t, uintptr_t, uintptr_t, uintptr_t);11static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {12 context->info = (void*) info;13 return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);14}15#cgo LDFLAGS: -framework CoreServices16*/17import "C"18import (19 "errors"20 "os"21 "sync"22 "sync/atomic"23 "time"24 "unsafe"25)26var nilstream C.FSEventStreamRef27// Default arguments for FSEventStreamCreate function.28var (29 latency C.CFTimeInterval30 flags = C.FSEventStreamCreateFlags(C.kFSEventStreamCreateFlagFileEvents | C.kFSEventStreamCreateFlagNoDefer)31 since = uint64(C.FSEventsGetCurrentEventId())32)33var runloop C.CFRunLoopRef // global runloop which all streams are registered with34var wg sync.WaitGroup // used to wait until the runloop starts35// source is used for synchronization purposes - it signals when runloop has36// started and is ready via the wg. It also serves purpose of a dummy source,37// thanks to it the runloop does not return as it also has at least one source38// registered.39var source = C.CFRunLoopSourceCreate(nil, 0, &C.CFRunLoopSourceContext{40 perform: (C.CFRunLoopPerformCallBack)(C.gosource),41})42// Errors returned when FSEvents functions fail.43var (44 errCreate = os.NewSyscallError("FSEventStreamCreate", errors.New("NULL"))45 errStart = os.NewSyscallError("FSEventStreamStart", errors.New("false"))46)47// initializes the global runloop and ensures any created stream awaits its48// readiness.49func init() {50 wg.Add(1)51 go func() {52 runloop = C.CFRunLoopGetCurrent()53 C.CFRunLoopAddSource(runloop, source, C.kCFRunLoopDefaultMode)54 C.CFRunLoopRun()55 panic("runloop has just unexpectedly stopped")56 }()57 C.CFRunLoopSourceSignal(source)58}59//export gosource60func gosource(unsafe.Pointer) {61 time.Sleep(time.Second)62 wg.Done()63}64//export gostream65func gostream(_, info uintptr, n C.size_t, paths, flags, ids uintptr) {66 const (67 offchar = unsafe.Sizeof((*C.char)(nil))68 offflag = unsafe.Sizeof(C.FSEventStreamEventFlags(0))69 offid = unsafe.Sizeof(C.FSEventStreamEventId(0))70 )71 if n == 0 {72 return73 }74 ev := make([]FSEvent, 0, int(n))75 for i := uintptr(0); i < uintptr(n); i++ {76 switch flags := *(*uint32)(unsafe.Pointer((flags + i*offflag))); {77 case flags&uint32(FSEventsEventIdsWrapped) != 0:78 atomic.StoreUint64(&since, uint64(C.FSEventsGetCurrentEventId()))79 default:80 ev = append(ev, FSEvent{81 Path: C.GoString(*(**C.char)(unsafe.Pointer(paths + i*offchar))),82 Flags: flags,83 ID: *(*uint64)(unsafe.Pointer(ids + i*offid)),84 })85 }86 }87 streamFuncs.get(info)(ev)88}89// StreamFunc is a callback called when stream receives file events.90type streamFunc func([]FSEvent)91var streamFuncs = streamFuncRegistry{m: map[uintptr]streamFunc{}}92type streamFuncRegistry struct {93 mu sync.Mutex94 m map[uintptr]streamFunc95 i uintptr96}97func (r *streamFuncRegistry) get(id uintptr) streamFunc {98 r.mu.Lock()99 defer r.mu.Unlock()100 return r.m[id]101}102func (r *streamFuncRegistry) add(fn streamFunc) uintptr {103 r.mu.Lock()104 defer r.mu.Unlock()105 r.i++106 r.m[r.i] = fn107 return r.i108}109func (r *streamFuncRegistry) delete(id uintptr) {110 r.mu.Lock()111 defer r.mu.Unlock()112 delete(r.m, id)113}114// Stream represents single watch-point which listens for events scheduled by115// the global runloop.116type stream struct {117 path string118 ref C.FSEventStreamRef119 info uintptr120}121// NewStream creates a stream for given path, listening for file events and122// calling fn upon receiving any.123func newStream(path string, fn streamFunc) *stream {124 return &stream{125 path: path,126 info: streamFuncs.add(fn),127 }128}129// Start creates a FSEventStream for the given path and schedules it with130// global runloop. It's a nop if the stream was already started.131func (s *stream) Start() error {132 if s.ref != nilstream {133 return nil134 }135 wg.Wait()136 p := C.CFStringCreateWithCStringNoCopy(nil, C.CString(s.path), C.kCFStringEncodingUTF8, nil)137 path := C.CFArrayCreate(nil, (*unsafe.Pointer)(unsafe.Pointer(&p)), 1, nil)138 ctx := C.FSEventStreamContext{}139 ref := C.EventStreamCreate(&ctx, C.uintptr_t(s.info), path, C.FSEventStreamEventId(atomic.LoadUint64(&since)), latency, flags)140 if ref == nilstream {141 return errCreate142 }143 C.FSEventStreamScheduleWithRunLoop(ref, runloop, C.kCFRunLoopDefaultMode)144 if C.FSEventStreamStart(ref) == C.Boolean(0) {145 C.FSEventStreamInvalidate(ref)146 return errStart147 }148 C.CFRunLoopWakeUp(runloop)149 s.ref = ref150 return nil151}152// Stop stops underlying FSEventStream and unregisters it from global runloop.153func (s *stream) Stop() {154 if s.ref == nilstream {155 return156 }157 wg.Wait()158 C.FSEventStreamStop(s.ref)159 C.FSEventStreamInvalidate(s.ref)160 C.CFRunLoopWakeUp(runloop)161 s.ref = nilstream162 streamFuncs.delete(s.info)163}...

Full Screen

Full Screen

stream

Using AI Code Generation

copy

Full Screen

1$stream = new \mock\atoum\streams\std\out();2$stream = new \mock\atoum\streams\std\out();3$stream = new \mock\atoum\streams\std\out();4$stream = new \mock\atoum\streams\std\out();5$stream = new \mock\atoum\streams\std\out();6$stream = new \mock\atoum\streams\std\out();7$stream = new \mock\atoum\streams\std\out();8$stream = new \mock\atoum\streams\std\out();9$stream = new \mock\atoum\streams\std\out();10$stream = new \mock\atoum\streams\std\out();11$stream = new \mock\atoum\streams\std\out();12$stream = new \mock\atoum\streams\std\out();13$stream = new \mock\atoum\streams\std\out();14$stream = new \mock\atoum\streams\std\out();

Full Screen

Full Screen

stream

Using AI Code Generation

copy

Full Screen

1require_once('./atoum/classes/stream.php');2require_once('./atoum/classes/file.php');3require_once('./atoum/classes/directory.php');4require_once('./atoum/classes/test.php');5require_once('./atoum/classes/codeCoverage.php');6require_once('./atoum/classes/locale.php');7require_once('./atoum/classes/mock.php');8require_once('./atoum/classes/score.php');9require_once('./atoum/classes/exception.php');10require_once('./atoum/classes/test.php');11require_once('./atoum/classes/adapter.php');12require_once('./atoum/classes/asserter.php');13require_once('./atoum/classes/asserters/adapter.php');14require_once('./atoum/classes/asserters/boolean.php');15require_once('./atoum/classes/asserters/float.php');16require_once('./atoum/classes/asserters/integer.php');17require_once('./atoum/classes/asserters/phpArray.php');18require_once('./atoum/classes/asserters/phpClass.php');19require_once('./atoum/classes/asserters/phpFunction.php');20require_once('./atoum/classes/asserters/phpObject.php');21require_once('./atoum/classes/asserters/phpString.php');22require_once('./atoum/classes/asserters/phpVariable.php');

Full Screen

Full Screen

stream

Using AI Code Generation

copy

Full Screen

1$stream = new stream();2$stream->addWriter(new atoum\writers\std\out());3$stream = new stream();4$stream->addWriter(new atoum\writers\std\out());5$stream = new stream();6$stream->addWriter(new atoum\writers\std\out());7$stream = new stream();8$stream->addWriter(new atoum\writers\std\out());9$stream = new stream();10$stream->addWriter(new atoum\writers\std\out());11$stream = new stream();12$stream->addWriter(new atoum\writers\std\out());13$stream = new stream();14$stream->addWriter(new atoum\writers\std\out());15$stream = new stream();16$stream->addWriter(new atoum\writers\std\out());17$stream = new stream();18$stream->addWriter(new atoum\writers\std\out());19$stream = new stream();20$stream->addWriter(new atoum\writers\std\out());21$stream = new stream();22$stream->addWriter(new atoum\writers\std\out());23$stream = new stream();24$stream->addWriter(new atoum\writers\std\out());25$stream = new stream();26$stream->addWriter(new atoum\writers\

Full Screen

Full Screen

stream

Using AI Code Generation

copy

Full Screen

1$stream = new \mock\stream();2$stream->getMockController()->stream_open = function($path, $mode, $options, &$opened_path) {3 return true;4};5$stream->getMockController()->stream_read = function($count) {6 return 'foo';7};8$stream->getMockController()->stream_write = function($data) {9 return 3;10};11$stream->getMockController()->stream_tell = function() {12 return 3;13};14$stream->getMockController()->stream_eof = function() {15 return true;16};17$stream->getMockController()->stream_stat = function() {18 return ['size' => 3];19};20$stream->getMockController()->stream_seek = function($offset, $whence) {21 return true;22};23$stream->getMockController()->stream_flush = function() {24 return true;25};26$stream->getMockController()->stream_close = function() {27 return true;28};29$stream->getMockController()->stream_lock = function($operation) {30 return true;31};32$stream->getMockController()->stream_metadata = function($path, $option, $var) {33 return true;34};35$stream->getMockController()->url_stat = function($path, $flags) {36 return ['size' => 3];37};38$stream->getMockController()->unlink = function($path) {39 return true;40};41$stream->getMockController()->rename = function($path_from, $path_to) {42 return true;43};44$stream->getMockController()->mkdir = function($path, $mode, $options) {45 return true;46};47$stream->getMockController()->rmdir = function($path, $options) {48 return true;49};50$stream->getMockController()->stream_cast = function($cast_as) {51 return true;52};53$stream->getMockController()->stream_set_option = function($option, $arg1, $arg2) {54 return true;55};56$stream = new \mock\stream();57$stream->getMockController()->stream_open = function($path, $mode, $options, &$opened_path) {58 return true;59};60$stream->getMockController()->stream_read = function($count) {61 return 'foo';62};63$stream->getMockController()->stream_write = function($data) {64 return 3;65};

Full Screen

Full Screen

stream

Using AI Code Generation

copy

Full Screen

1require_once 'vendor/autoload.php';2use atoum\atoum;3$script->addTestsFromDirectory(__DIR__ . '/tests/units');4$runner->addTestsFromDirectory(__DIR__ . '/tests/units');5require_once 'vendor/autoload.php';6use atoum\atoum;7$script->addTestsFromDirectory(__DIR__ . '/tests/units');8$runner->addTestsFromDirectory(__DIR__ . '/tests/units');9require_once 'vendor/autoload.php';10use atoum\atoum;11$script->addTestsFromDirectory(__DIR__ . '/tests/units');12$runner->addTestsFromDirectory(__DIR__ . '/tests/units');13require_once 'vendor/autoload.php';14use atoum\atoum;15$script->addTestsFromDirectory(__DIR__ . '/tests/units');16$runner->addTestsFromDirectory(__DIR__ . '/tests/units');17require_once 'vendor/autoload.php';18use atoum\atoum;19$script->addTestsFromDirectory(__DIR__ . '/tests/units');20$runner->addTestsFromDirectory(__DIR__ . '/tests/units');21require_once 'vendor/autoload.php';22use atoum\atoum;23$script->addTestsFromDirectory(__DIR__ . '/tests/units');24$runner->addTestsFromDirectory(__DIR__ . '/tests/units');25require_once 'vendor/autoload.php';26use atoum\atoum;27$script->addTestsFromDirectory(__DIR__ . '/tests/units');28$runner->addTestsFromDirectory(__DIR__ . '/tests/units');29require_once 'vendor/autoload.php';

Full Screen

Full Screen

stream

Using AI Code Generation

copy

Full Screen

1$stream = new \mageekguy\atoum\writers\std\out();2$stream = new \streamWrapper();3$stream = new \streamWrapper();4$stream = new \streamWrapper();5$stream = new \mageekguy\atoum\writers\std\out();6$stream = new \streamWrapper();7$stream = new \streamWrapper();8$stream = new \streamWrapper();9$stream = new \mageekguy\atoum\writers\std\out();10$stream = new \streamWrapper();11$stream = new \streamWrapper();12$stream = new \streamWrapper();13$stream = new \mageekguy\atoum\writers\std\out();14$stream = new \streamWrapper();15$stream = new \streamWrapper();16$stream = new \streamWrapper();17$stream = new \mageekguy\atoum\writers\std\out();18$stream = new \streamWrapper();19$stream = new \streamWrapper();20$stream = new \streamWrapper();21$stream = new \mageekguy\atoum\writers\std\out();22$stream = new \streamWrapper();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Atoum automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful