blob: 6aab19916bbd1735cf50a84749f0a31f3de89161 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>DiffRepository (Apache Calcite API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.calcite.test, class: DiffRepository">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<div class="about-language"><b>Apache Calcite</b></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li><a href="#nested-class-summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.calcite.test</a></div>
<h1 title="Class DiffRepository" class="title">Class DiffRepository</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">org.apache.calcite.test.DiffRepository</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">DiffRepository</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
<div class="block">A collection of resources used by tests.
<p>Loads files containing test input and output into memory. If there are
differences, writes out a log file containing the actual output.
<p>Typical usage is as follows. A test case class defines a method
<blockquote><pre><code>
package com.acme.test;
&nbsp;
public class MyTest extends TestCase {
public DiffRepository getDiffRepos() {
return DiffRepository.lookup(MyTest.class);
}
&nbsp;
&#64;Test public void testToUpper() {
getDiffRepos().assertEquals("${result}", "${string}");
}
&nbsp;
&#64;Test public void testToLower() {
getDiffRepos().assertEquals("Multi-line\nstring", "${string}");
}
}
</code></pre></blockquote>
<p>There is an accompanying reference file named after the class,
<code>src/test/resources/com/acme/test/MyTest.xml</code>:</p>
<blockquote><pre><code>
&lt;Root&gt;
&lt;TestCase name="testToUpper"&gt;
&lt;Resource name="string"&gt;
&lt;![CDATA[String to be converted to upper case]]&gt;
&lt;/Resource&gt;
&lt;Resource name="result"&gt;
&lt;![CDATA[STRING TO BE CONVERTED TO UPPER CASE]]&gt;
&lt;/Resource&gt;
&lt;/TestCase&gt;
&lt;TestCase name="testToLower"&gt;
&lt;Resource name="result"&gt;
&lt;![CDATA[multi-line
string]]&gt;
&lt;/Resource&gt;
&lt;/TestCase&gt;
&lt;/Root&gt;
</code></pre></blockquote>
<p>If any of the test cases fails, a log file is generated, called
<code>build/resources/test/com/acme/test/MyTest_actual.xml</code>, containing the actual
output.</p>
<p>The log
file is otherwise identical to the reference log, so once the log file has
been verified, it can simply be copied over to become the new reference
log:</p>
<blockquote><code>cp build/resources/test/com/acme/test/MyTest_actual.xml
src/test/resources/com/acme/test/MyTest.xml</code></blockquote>
<p>If a resource or test case does not exist, <code>DiffRepository</code>
creates them in the log file. Because DiffRepository is so forgiving, it is
very easy to create new tests and test cases.</p>
<p>The <a href="#lookup(java.lang.Class)"><code>lookup(java.lang.Class&lt;?&gt;)</code></a> method ensures that all test cases share the same
instance of the repository. This is important more than one test case fails.
The shared instance ensures that the generated
<code>build/resources/test/com/acme/test/MyTest_actual.xml</code>
file contains the actual for <em>both</em> test cases.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<li>
<section class="nested-class-summary" id="nested-class-summary">
<h2>Nested Class Summary</h2>
<div class="caption"><span>Nested Classes</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Class</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static interface&nbsp;</code></div>
<div class="col-second even-row-color"><code><a href="DiffRepository.Filter.html" class="type-name-link" title="interface in org.apache.calcite.test">DiffRepository.Filter</a></code></div>
<div class="col-last even-row-color">
<div class="block">Callback to filter strings before returning them.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#amend(java.lang.String,java.lang.String)" class="member-name-link">amend</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;expected,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;actual)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#assertEquals(java.lang.String,java.lang.String,java.lang.String)" class="member-name-link">assertEquals</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;tag,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;expected,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;actual)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#castNonNull(org.apache.calcite.test.DiffRepository)" class="member-name-link">castNonNull</a><wbr>(@Nullable <a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a>&nbsp;diffRepos)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the diff repository, checking that it is not null.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#checkActualAndReferenceFiles()" class="member-name-link">checkActualAndReferenceFiles</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#expand(java.lang.String,java.lang.String)" class="member-name-link">expand</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;tag,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;text)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Expands a string containing one or more variables.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#lookup(java.lang.Class)" class="member-name-link">lookup</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;clazz)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Finds the repository instance for a given class, with no base
repository or filter.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#lookup(java.lang.Class,org.apache.calcite.test.DiffRepository,org.apache.calcite.test.DiffRepository.Filter,int)" class="member-name-link">lookup</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;clazz,
<a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a>&nbsp;baseRepository,
<a href="DiffRepository.Filter.html" title="interface in org.apache.calcite.test">DiffRepository.Filter</a>&nbsp;filter,
int&nbsp;indent)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Finds the repository instance for a given class.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#set(java.lang.String,java.lang.String)" class="member-name-link">set</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;resourceName,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the value of a given resource of the current test case.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="checkActualAndReferenceFiles()">
<h3>checkActualAndReferenceFiles</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkActualAndReferenceFiles</span>()</div>
</section>
</li>
<li>
<section class="detail" id="castNonNull(org.apache.calcite.test.DiffRepository)">
<h3>castNonNull</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a></span>&nbsp;<span class="element-name">castNonNull</span><wbr><span class="parameters">(@Nullable <a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a>&nbsp;diffRepos)</span></div>
<div class="block">Returns the diff repository, checking that it is not null.
<p>If it is null, throws <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link"><code>IllegalArgumentException</code></a> with a message
informing people that they need to change their test configuration.</div>
</section>
</li>
<li>
<section class="detail" id="expand(java.lang.String,java.lang.String)">
<h3>expand</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">expand</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;tag,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;text)</span></div>
<div class="block">Expands a string containing one or more variables. (Currently only works
if there is one variable.)</div>
</section>
</li>
<li>
<section class="detail" id="set(java.lang.String,java.lang.String)">
<h3>set</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">set</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;resourceName,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</span></div>
<div class="block">Sets the value of a given resource of the current test case.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>resourceName</code> - Name of the resource, e.g. "sql"</dd>
<dd><code>value</code> - Value of the resource</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="amend(java.lang.String,java.lang.String)">
<h3>amend</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">amend</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;expected,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;actual)</span></div>
</section>
</li>
<li>
<section class="detail" id="assertEquals(java.lang.String,java.lang.String,java.lang.String)">
<h3>assertEquals</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">assertEquals</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;tag,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;expected,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;actual)</span></div>
</section>
</li>
<li>
<section class="detail" id="lookup(java.lang.Class)">
<h3>lookup</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a></span>&nbsp;<span class="element-name">lookup</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;clazz)</span></div>
<div class="block">Finds the repository instance for a given class, with no base
repository or filter.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>clazz</code> - Test case class</dd>
<dt>Returns:</dt>
<dd>The diff repository shared between test cases in this class.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="lookup(java.lang.Class,org.apache.calcite.test.DiffRepository,org.apache.calcite.test.DiffRepository.Filter,int)">
<h3>lookup</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a></span>&nbsp;<span class="element-name">lookup</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;?&gt;&nbsp;clazz,
<a href="DiffRepository.html" title="class in org.apache.calcite.test">DiffRepository</a>&nbsp;baseRepository,
<a href="DiffRepository.Filter.html" title="interface in org.apache.calcite.test">DiffRepository.Filter</a>&nbsp;filter,
int&nbsp;indent)</span></div>
<div class="block">Finds the repository instance for a given class.
<p>It is important that all test cases in a class share the same
repository instance. This ensures that, if two or more test cases fail,
the log file will contains the actual results of both test cases.
<p>The <code>baseRepository</code> parameter is useful if the test is an
extension to a previous test. If the test class has a base class which
also has a repository, specify the repository here. DiffRepository will
look for resources in the base class if it cannot find them in this
repository. If test resources from test cases in the base class are
missing or incorrect, it will not write them to the log file -- you
probably need to fix the base test.
<p>Use the <code>filter</code> parameter if you expect the test to
return results slightly different than in the repository. This happens
if the behavior of a derived test is slightly different than a base
test. If you do not specify a filter, no filtering will happen.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>clazz</code> - Test case class</dd>
<dd><code>baseRepository</code> - Base repository</dd>
<dd><code>filter</code> - Filters each string returned by the repository</dd>
<dd><code>indent</code> - Indent of the XML file (usually 2)</dd>
<dt>Returns:</dt>
<dd>The diff repository shared between test cases in this class</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &copy; 2012-2023 Apache Software Foundation. All Rights Reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>