</dependency>
<!-- Testing Dependencies -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sal-binding-broker-impl</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sal-binding-broker-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
import static com.google.common.truth.Truth.assertThat;
import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.Collections.singletonList;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.Test;
+import org.opendaylight.controller.md.sal.binding.test.DataBrokerTestModule;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
*/
public class TracingBrokerTest {
+ @Test
+ public void testEnd2End() {
+ DataBrokerTestModule wiring = new DataBrokerTestModule(true);
+ wiring.getDataBroker(); // required so DataBrokerTestModule creates the DOMDataBroker
+ DOMDataBroker realDomBroker = wiring.getDOMDataBroker();
+ TracingBroker tracingDomBroker = new TracingBroker("Test", realDomBroker, new ConfigBuilder()
+ // CONTROLLER-1877: configure it like the default/initial mdsaltrace_config.xml in mdsal-trace-api
+ .setTransactionDebugContextEnabled(true)
+ .setWriteWatches(singletonList("/this/will/never/exist"))
+ .setRegistrationWatches(singletonList("/this/will/never/exist"))
+ .build(),
+ wiring.getBindingToNormalizedNodeCodec());
+ tracingDomBroker.newWriteOnlyTransaction().cancel();
+ }
+
@Test
@SuppressWarnings({ "resource", "unused" }) // Finding resource leaks is the point of this test
public void testPrintOpenTransactions() {