MCPcopy Index your code
hub / github.com/grpc/grpc-java / rootCanBeAttached

Method rootCanBeAttached

api/src/test/java/io/grpc/ContextTest.java:124–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 }
123
124 @Test
125 public void rootCanBeAttached() {
126 Context fork = Context.ROOT.fork();
127 Context toRestore1 = fork.attach();
128 Context toRestore2 = Context.ROOT.attach();
129 assertTrue(Context.ROOT.isCurrent());
130
131 Context toRestore3 = fork.attach();
132 assertTrue(fork.isCurrent());
133
134 fork.detach(toRestore3);
135 Context.ROOT.detach(toRestore2);
136 fork.detach(toRestore1);
137 }
138
139 @Test
140 public void rootCanNeverHaveAListener() {

Callers

nothing calls this directly

Calls 6

attachMethod · 0.95
isCurrentMethod · 0.95
detachMethod · 0.95
forkMethod · 0.80
detachMethod · 0.65
isCurrentMethod · 0.45

Tested by

no test coverage detected