question stringlengths 935 50.2k | answer stringlengths 92 8.26k |
|---|---|
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'decode' in class 'org.kaazing.k3po.driver.internal.behavior.ha... | ```java
@Test(expected = ScriptProgressException.class)
public void NoMatchOK() throws Exception {
MessageDecoder decoder = new ReadExactTextDecoder("Hello", UTF_8);
decoder.decode(copiedBuffer("Goodbye", UTF_8));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'decode' in class 'org.kaazing.k3po.driver.internal.behavior.ha... | ```java
@Test(expected = ScriptProgressException.class)
public void onlyPartialMatchOK() throws Exception {
MessageDecoder decoder = new ReadExactTextDecoder("Hello", UTF_8);
ChannelBuffer remainingBuffer = decoder.decode(copiedBuffer("He", UTF_8));
assertNull(remainingBuffer);
decoder.decode(copiedBuff... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'decode' in class 'org.kaazing.k3po.driver.internal.behavior.ha... | ```java
@Test(expected = ScriptProgressException.class)
public void noMatchOK() throws Exception {
ValueExpression expression = expressionFactory.createValueExpression(environment, "${variable}", byte[].class);
MessageDecoder decoder = new ReadExpressionDecoder(expression, environment);
environment.getELRes... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'decode' in class 'org.kaazing.k3po.driver.internal.behavior.ha... | ```java
@Test(expected = ScriptProgressException.class)
public void onlyPartialMatchOK() throws Exception {
ValueExpression expression = expressionFactory.createValueExpression(environment, "${variable}", byte[].class);
MessageDecoder decoder = new ReadExpressionDecoder(expression, environment);
environment... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'decode' in class 'org.kaazing.k3po.driver.internal.behavior.ha... | ```java
@Test(expected = ScriptProgressException.class)
public void NoMatchOK() throws Exception {
MessageDecoder decoder = new ReadExactBytesDecoder(new byte[] { 0x01, 0x02, 0x03 });
decoder.decode(copiedBuffer(new byte[] { 0x01, 0x02, 0x04 }));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'decode' in class 'org.kaazing.k3po.driver.internal.behavior.ha... | ```java
@Test(expected = ScriptProgressException.class)
public void onlyPartialMatchOK() throws Exception {
MessageDecoder decoder = new ReadExactBytesDecoder(new byte[] { 0x01, 0x02, 0x03 });
ChannelBuffer remainingBuffer = decoder.decode(copiedBuffer(new byte[] { 0x01, 0x02 }));
assertNull(remainingBuffer... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'decode' in class 'org.kaazing.k3po.driver.internal.behavior.ha... | ```java
@Test(expected = ScriptProgressException.class)
public void testHttpMethodDecoderFails() throws Exception {
MessageDecoder methodValueDecoder = new ReadExactTextDecoder("GET", UTF_8);
Mockery context = new Mockery();
final Channel channel = context.mock(Channel.class);
final HttpChannelConfig ht... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'decode' in class 'org.kaazing.k3po.driver.internal.behavior.ha... | ```java
@Test(expected = ScriptProgressException.class)
public void noMatchOK() throws Exception {
NamedGroupPattern pattern = NamedGroupPattern.compile("H.*o\\n");
MessageDecoder decoder = new ReadRegexDecoder(pattern, UTF_8, environment);
decoder.decode(copiedBuffer("Hellf\n", UTF_8));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'decode' in class 'org.kaazing.k3po.driver.internal.behavior.ha... | ```java
@Test(expected = ScriptProgressException.class)
public void noMatchWithCaptureOK() throws Exception {
NamedGroupPattern pattern = NamedGroupPattern.compile("(?<var>H.*o)\\n");
MessageDecoder decoder = new ReadRegexDecoder(pattern, UTF_8, environment);
decoder.decode(copiedBuffer("Hellf\n", UTF_8));
... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'org.kaazing.k3po.driver.internal.behavior.par... | ```java
@Test(expected = ScriptParseException.class)
public void shouldNotParseScriptWithoutConnect() throws Exception {
String script = "# tcp.client.connect-then-close\n" + "connected\n" + "close\n" + "closed\n";
ScriptParser parser = new Parser();
parser.parse(script);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'org.kaazing.k3po.driver.internal.behavior.par... | ```java
@Test(expected = ScriptParseException.class)
public void shouldNotParseScriptWithMultiplyClosedStream() throws Exception {
String script = "# tcp.client.connect-then-close\n" + "connect tcp://localhost:7788\n" + "connected\n" + "close\n" + "closed\n" + "close\n" + "closed\n";
ScriptParser parser = new P... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'visit' in class 'org.kaazing.k3po.driver.internal.behavior.vis... | ```java
@Test(expected = IllegalStateException.class)
public void shouldNotAllowWriteAfterRequestResponseWithoutSwitchingProtocols() throws Exception {
AstScriptNode inputScript = new AstScriptNodeBuilder().addAcceptStream().setLocation(new AstLiteralURIValue(URI.create("http://localhost:8000/somepath"))).addAccept... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'prepare' in class 'org.kaazing.k3po.driver.internal.Robot' for... | ```java
@Test(expected = ScriptParseException.class)
public void parseErrorThrowsExceptionOnPrepare() throws Exception {
String script = "foobar";
robot.prepare(script);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'prepareAndStart' in class 'org.kaazing.k3po.driver.internal.Ro... | ```java
@Test(expected = ScriptParseException.class)
public void parseErrorThrowsExceptionOnPrepareAndStart() throws Exception {
String script = "foobar";
robot.prepareAndStart(script);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'start' in class 'org.kaazing.k3po.driver.internal.Robot' for t... | ```java
@Test(expected = IllegalStateException.class)
public void canNotStartWithoutPrepare() throws Exception {
robot.start();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'newChannelAddress' in class 'org.kaazing.k3po.driver.internal.... | ```java
@Test(expected = ChannelException.class)
public void shouldNotCreateChannelAddressWithPort() throws Exception {
AgronaChannelAddressFactorySpi channelAddressFactorySpi = new AgronaChannelAddressFactorySpi();
Map<String, Object> options = Collections.emptyMap();
URI location = URI.create("agrona://st... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'newChannelAddress' in class 'org.kaazing.k3po.driver.internal.... | ```java
@Test(expected = ChannelException.class)
public void shouldNotCreateChannelAddressWithNonStreamHost() throws Exception {
AgronaChannelAddressFactorySpi channelAddressFactorySpi = new AgronaChannelAddressFactorySpi();
Map<String, Object> options = Collections.emptyMap();
URI location = URI.create("ag... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'newChannelAddress' in class 'org.kaazing.k3po.driver.internal.... | ```java
@Test(expected = ChannelException.class)
public void shouldNotCreateChannelAddressWithNonBidirectionalPath() throws Exception {
AgronaChannelAddressFactorySpi channelAddressFactorySpi = new AgronaChannelAddressFactorySpi();
Map<String, Object> options = Collections.emptyMap();
URI location = URI.cre... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'newChannel' in class 'org.kaazing.k3po.driver.internal.netty.b... | ```java
@Test(expected = Exception.class)
public void shouldFailToBindMoreThanOnceWithEquivalentAddresses() throws Exception {
server.setPipeline(pipeline(new SimpleChannelHandler()));
ChannelAddressFactory channelAddressFactory = newChannelAddressFactory();
ChannelAddress channelAddress1 = channelAddressFa... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'writeCommand' in class 'org.kaazing.k3po.control.internal.Cont... | ```java
@Test(expected = IllegalStateException.class)
public void shouldNotWriteCommand() throws Exception {
StartCommand start = new StartCommand();
control.writeCommand(start);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'readEvent' in class 'org.kaazing.k3po.control.internal.Control... | ```java
@Test(expected = IllegalStateException.class)
public void shouldNotReadEvent() throws Exception {
control.readEvent();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.managed.ManagedE... | ```java
@Test(expected = NullPointerException.class)
public void ensureEsConfigurationIsNotNull() {
new ManagedEsClient((EsConfiguration) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.managed.ManagedE... | ```java
@Test(expected = NullPointerException.class)
public void ensureNodeIsNotNull() {
new ManagedEsClient((Node) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.managed.ManagedE... | ```java
@Test(expected = NullPointerException.class)
public void ensureClientIsNotNull() {
new ManagedEsClient((Client) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'fromHostAndPort' in class 'io.dropwizard.elasticsearch.util.Tr... | ```java
@Test(expected = NullPointerException.class)
public void fromHostAndPortWithNullShouldFail() {
TransportAddressHelper.fromHostAndPort(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.health.EsIndexDo... | ```java
@Test(expected = NullPointerException.class)
public void initializationWithNullClientShouldFail() {
new EsIndexDocsHealthCheck(null, "index");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.health.EsIndexDo... | ```java
@Test(expected = IllegalArgumentException.class)
public void initializationWithoutIndicesShouldFail() {
new EsIndexDocsHealthCheck(mock(Client.class), Collections.<String>emptyList());
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.health.EsIndexDo... | ```java
@Test(expected = NullPointerException.class)
public void initializationWithoutIndexShouldFail() {
new EsIndexDocsHealthCheck(mock(Client.class), (String) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.health.EsIndexDo... | ```java
@Test(expected = IllegalArgumentException.class)
public void initializationWithDocumentThresholdTooLowShouldFail() {
new EsIndexDocsHealthCheck(mock(Client.class), "index", 0L);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.health.EsCluster... | ```java
@Test(expected = NullPointerException.class)
public void initializationWithNullClientShouldFail() {
new EsClusterHealthCheck(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.health.EsIndexEx... | ```java
@Test(expected = NullPointerException.class)
public void initializationWithNullClientShouldFail() {
new EsIndexExistsHealthCheck(null, "index");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.health.EsIndexEx... | ```java
@Test(expected = IllegalArgumentException.class)
public void initializationWithoutIndicesShouldFail() {
new EsIndexExistsHealthCheck(mock(Client.class), Collections.<String>emptyList());
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'io.dropwizard.elasticsearch.health.EsIndexEx... | ```java
@Test(expected = NullPointerException.class)
public void initializationWithoutIndexShouldFail() {
new EsIndexExistsHealthCheck(mock(Client.class), (String) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getInstrumentConfig' in class 'com.google.caliper.config.Calip... | ```java
@Test(expected = IllegalArgumentException.class)
public void getInstrumentConfig_notConfigured() throws Exception {
CaliperConfig configuration = new CaliperConfig(ImmutableMap.of("instrument.test.options.a", "1", "instrument.test.options.b", "excited b b excited"));
configuration.getInstrumentConfig("t... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'valueOf' in class 'com.google.caliper.util.ShortDuration' for ... | ```java
@Test(expected = ArithmeticException.class)
public void tooLongForALong() {
ShortDuration.valueOf("106751.99116730064592 days");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'exitlessMain' in class 'com.google.caliper.runner.CaliperMain'... | ```java
@Test(expected = UserCodeException.class)
public void testExceptionInInit() throws Exception {
runner.forBenchmark(ExceptionInInitBenchmark.class).run();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'exitlessMain' in class 'com.google.caliper.runner.CaliperMain'... | ```java
@Test(expected = UserCodeException.class)
public void testExceptionInConstructor() throws Exception {
runner.forBenchmark(ExceptionInConstructorBenchmark.class).run();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'exitlessMain' in class 'com.google.caliper.runner.CaliperMain'... | ```java
@Test(expected = UserCodeException.class)
public void testExceptionInMethod() throws Exception {
runner.forBenchmark(ExceptionInMethodBenchmark.class).run();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'exitlessMain' in class 'com.google.caliper.runner.CaliperMain'... | ```java
@Test(expected = UserCodeException.class)
public void testExceptionInSetUp() throws Exception {
runner.forBenchmark(ExceptionInSetUpBenchmark.class).run();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'forClass' in class 'com.google.caliper.runner.BenchmarkClass' ... | ```java
@Test(expected = InvalidBenchmarkException.class)
public void forClass_inheritenceThrows() throws Exception {
BenchmarkClass.forClass(MalformedBenhcmark.class);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createInstrumentation' in class 'com.google.caliper.runner.Run... | ```java
@Test(expected = InvalidBenchmarkException.class)
public void createInstrumentation_badParam() throws Exception {
Method benchmarkMethod = RuntimeBenchmark.class.getDeclaredMethod("integerParam", Integer.class);
instrument.createInstrumentation(benchmarkMethod);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createInstrumentation' in class 'com.google.caliper.runner.Run... | ```java
@Test(expected = IllegalArgumentException.class)
public void createInstrumentation_notAMacrobenchmark() throws Exception {
Method benchmarkMethod = RuntimeBenchmark.class.getDeclaredMethod("notAMacrobenchmark");
instrument.createInstrumentation(benchmarkMethod);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createInstrumentation' in class 'com.google.caliper.runner.Run... | ```java
@Test(expected = IllegalArgumentException.class)
public void createInstrumentationnotAMicrobenchmark() throws Exception {
Method benchmarkMethod = RuntimeBenchmark.class.getDeclaredMethod("notAMicrobenchmark", int.class);
instrument.createInstrumentation(benchmarkMethod);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'createInstrumentation' in class 'com.google.caliper.runner.Run... | ```java
@Test(expected = IllegalArgumentException.class)
public void createInstrumentation_notAPicobenchmark() throws Exception {
Method benchmarkMethod = RuntimeBenchmark.class.getDeclaredMethod("notAPicobenchmark", long.class);
instrument.createInstrumentation(benchmarkMethod);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getConnection' in class 'com.google.caliper.runner.ServerSocke... | ```java
@Test(expected = IllegalStateException.class)
public void getConnectionIdTwice_acceptComesFirst() throws Exception {
UUID id = UUID.randomUUID();
OpenedSocket clientSocket = openConnectionAndIdentify(id);
ListenableFuture<OpenedSocket> pendingServerConnection = service.getConnection(id);
OpenedS... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'shutDown' in class 'com.google.caliper.runner.ServerSocketServ... | ```java
@Test(expected = ExecutionException.class)
public void getConnectionStoppedService() throws Exception {
UUID id = UUID.randomUUID();
ListenableFuture<OpenedSocket> pendingServerConnection = service.getConnection(id);
assertFalse(pendingServerConnection.isDone());
service.stopAsync().awaitTermina... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'safeIntToShort' in class 'edu.jhu.prim.util.SafeCast' for the ... | ```java
@Test(expected = IllegalStateException.class)
public void testIntToShortOverflow() {
SafeCast.safeIntToShort(Short.MAX_VALUE + 1);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'safeIntToShort' in class 'edu.jhu.prim.util.SafeCast' for the ... | ```java
@Test(expected = IllegalStateException.class)
public void testIntToShortUnderflow() {
SafeCast.safeIntToShort(Short.MIN_VALUE - 1);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'safeIntToByte' in class 'edu.jhu.prim.util.SafeCast' for the e... | ```java
@Test(expected = IllegalStateException.class)
public void testIntToByteOverflow() {
SafeCast.safeIntToByte(Byte.MAX_VALUE + 1);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'safeIntToByte' in class 'edu.jhu.prim.util.SafeCast' for the e... | ```java
@Test(expected = IllegalStateException.class)
public void testIntToByteUnderflow() {
SafeCast.safeIntToByte(Byte.MIN_VALUE - 1);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'safeIntToUnsignedShort' in class 'edu.jhu.prim.util.SafeCast' ... | ```java
@Test(expected = IllegalStateException.class)
public void testIntToUnsignedShortOverflow() {
SafeCast.safeIntToUnsignedShort((int) (Math.pow(2, 16)));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'safeIntToUnsignedShort' in class 'edu.jhu.prim.util.SafeCast' ... | ```java
@Test(expected = IllegalStateException.class)
public void testIntToUnsignedShortUnderflow() {
SafeCast.safeIntToUnsignedShort(-1);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'safeIntToUnsignedByte' in class 'edu.jhu.prim.util.SafeCast' f... | ```java
@Test(expected = IllegalStateException.class)
public void testIntToUnsignedByteOverflow() {
SafeCast.safeIntToUnsignedByte((int) (Math.pow(2, 16)));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'safeIntToUnsignedByte' in class 'edu.jhu.prim.util.SafeCast' f... | ```java
@Test(expected = IllegalStateException.class)
public void testIntToUnsignedByteUnderflow() {
SafeCast.safeIntToUnsignedByte(-1);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'set' in class 'edu.jhu.prim.vector.LongDoubleVectorSlice' for ... | ```java
@Test(expected = Exception.class)
public void testGetSet() {
LongDoubleVector v1 = new LongDoubleDenseVector();
v1.set(0, toDouble(0));
v1.set(1, toDouble(1));
v1.set(2, toDouble(2));
v1.set(3, toDouble(3));
v1.set(4, toDouble(4));
LongDoubleVectorSlice v2 = new LongDoubleVectorSlice... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'add' in class 'edu.jhu.prim.vector.LongDoubleVectorSlice' for ... | ```java
@Test(expected = Exception.class)
public void testAdd() {
LongDoubleVector v1 = new LongDoubleDenseVector();
v1.set(0, toDouble(2));
v1.set(1, toDouble(1));
v1.set(2, toDouble(1));
v1.set(3, toDouble(1));
v1.set(4, toDouble(3));
LongDoubleVectorSlice v2 = new LongDoubleVectorSlice((L... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'get' in class 'edu.jhu.prim.list.DoubleArrayList' for the exce... | ```java
@Test(expected = IndexOutOfBoundsException.class)
public void testClearGetSize() {
DoubleArrayList list = new DoubleArrayList();
list.add(getDouble(1));
list.add(getDouble(2));
list.add(getDouble(3));
list.get(3);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'set' in class 'edu.jhu.prim.list.DoubleArrayList' for the exce... | ```java
@Test(expected = IndexOutOfBoundsException.class)
public void testSet() {
DoubleArrayList list = new DoubleArrayList();
list.add(getDouble(1));
list.add(getDouble(2));
list.add(getDouble(3));
list.set(3, 0);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'get' in class 'edu.jhu.prim.list.LongArrayList' for the except... | ```java
@Test(expected = IndexOutOfBoundsException.class)
public void testClearGetSize() {
LongArrayList list = new LongArrayList();
list.add(getLong(1));
list.add(getLong(2));
list.add(getLong(3));
list.get(3);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'set' in class 'edu.jhu.prim.list.LongArrayList' for the except... | ```java
@Test(expected = IndexOutOfBoundsException.class)
public void testSet() {
LongArrayList list = new LongArrayList();
list.add(getLong(1));
list.add(getLong(2));
list.add(getLong(3));
list.set(3, 0);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.FieldElement$Builder... | ```java
@Test(expected = NullPointerException.class)
public void labelRequired() {
FieldElement.builder().type(STRING).name("name").tag(1).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.FieldElement$Builder... | ```java
@Test(expected = NullPointerException.class)
public void typeRequired() {
FieldElement.builder().label(REQUIRED).name("name").tag(1).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.FieldElement$Builder... | ```java
@Test(expected = NullPointerException.class)
public void nameRequired() {
FieldElement.builder().label(REQUIRED).type(STRING).tag(1).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.FieldElement$Builder... | ```java
@Test(expected = NullPointerException.class)
public void tagRequired() {
FieldElement.builder().label(REQUIRED).type(STRING).name("name").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'type' in class 'com.squareup.protoparser.FieldElement$Builder'... | ```java
@Test(expected = NullPointerException.class)
public void nullBuilderValuesThrow() {
FieldElement.builder().type(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.EnumConstantElement$... | ```java
@Test(expected = NullPointerException.class)
public void nameRequired() {
EnumConstantElement.builder().tag(1).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.EnumConstantElement$... | ```java
@Test(expected = NullPointerException.class)
public void tagRequired() {
EnumConstantElement.builder().name("Test").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'name' in class 'com.squareup.protoparser.EnumConstantElement$B... | ```java
@Test(expected = NullPointerException.class)
public void nullBuilderValuesThrow() {
EnumConstantElement.builder().name(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'builder' in class 'com.squareup.protoparser.ProtoFile' for the... | ```java
@Test(expected = NullPointerException.class)
public void nullBuilderValuesThrow() {
ProtoFile.builder(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.ExtendElement$Builde... | ```java
@Test(expected = NullPointerException.class)
public void nameRequired() {
ExtendElement.builder().qualifiedName("Test").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'name' in class 'com.squareup.protoparser.ExtendElement$Builder... | ```java
@Test(expected = NullPointerException.class)
public void nullBuilderValuesThrow() {
ExtendElement.builder().name(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.ExtendElement$Builde... | ```java
@Test(expected = IllegalStateException.class)
public void duplicateTagValueThrows() {
FieldElement field1 = FieldElement.builder().label(REQUIRED).type(STRING).name("name1").tag(1).build();
FieldElement field2 = FieldElement.builder().label(REQUIRED).type(STRING).name("name2").tag(1).build();
Extend... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.RpcElement$Builder' ... | ```java
@Test(expected = NullPointerException.class)
public void nameRequired() {
RpcElement.builder().requestType(NamedType.create("Foo")).responseType(NamedType.create("Bar")).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.RpcElement$Builder' ... | ```java
@Test(expected = NullPointerException.class)
public void requestTypeRequired() {
RpcElement.builder().name("Test").responseType(NamedType.create("Bar")).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.RpcElement$Builder' ... | ```java
@Test(expected = NullPointerException.class)
public void responseTypeRequired() {
RpcElement.builder().name("Test").requestType(NamedType.create("Foo")).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'name' in class 'com.squareup.protoparser.RpcElement$Builder' f... | ```java
@Test(expected = NullPointerException.class)
public void nullBuilderValuesThrow() {
RpcElement.builder().name(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'create' in class 'com.squareup.protoparser.OptionElement' for ... | ```java
@Test(expected = NullPointerException.class)
public void nullNameThrows() {
OptionElement.create(null, STRING, "Test");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'create' in class 'com.squareup.protoparser.OptionElement' for ... | ```java
@Test(expected = NullPointerException.class)
public void nullValueThrows() {
OptionElement.create("test", STRING, null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'findByName' in class 'com.squareup.protoparser.OptionElement' ... | ```java
@Test(expected = IllegalStateException.class)
public void findInListDuplicate() {
OptionElement one = OptionElement.create("one", STRING, "1");
OptionElement two = OptionElement.create("two", STRING, "2");
List<OptionElement> options = list(one, two, one);
OptionElement.findByName(options, "one"... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.MessageElement$Build... | ```java
@Test(expected = NullPointerException.class)
public void nameRequired() {
MessageElement.builder().qualifiedName("Test").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'name' in class 'com.squareup.protoparser.MessageElement$Builde... | ```java
@Test(expected = NullPointerException.class)
public void nullBuilderValuesThrow() {
MessageElement.builder().name(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.MessageElement$Build... | ```java
@Test(expected = IllegalStateException.class)
public void duplicateTagValueThrows() {
FieldElement field1 = FieldElement.builder().label(REQUIRED).type(STRING).name("name1").tag(1).build();
FieldElement field2 = FieldElement.builder().label(REQUIRED).type(STRING).name("name2").tag(1).build();
Messag... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.MessageElement$Build... | ```java
@Test(expected = IllegalStateException.class)
public void duplicateTagValueOneOfThrows() {
FieldElement field1 = FieldElement.builder().label(REQUIRED).type(STRING).name("name1").tag(1).build();
FieldElement field2 = FieldElement.builder().label(ONE_OF).type(STRING).name("name2").tag(1).build();
One... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.MessageElement$Build... | ```java
@Test(expected = IllegalStateException.class)
public void oneOfFieldDisallowed() {
FieldElement field1 = FieldElement.builder().label(ONE_OF).type(STRING).name("name").tag(1).build();
MessageElement.builder().name("Message").qualifiedName("example.Message").addField(field1).build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.MessageElement$Build... | ```java
@Test(expected = IllegalStateException.class)
public void duplicateEnumValueTagInScopeThrows() {
EnumConstantElement value = EnumConstantElement.builder().name("VALUE").tag(1).build();
TypeElement enum1 = EnumElement.builder().name("Enum1").qualifiedName("example.Enum1").addConstant(value).build();
... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'create' in class 'com.squareup.protoparser.ExtensionsElement' ... | ```java
@Test(expected = IllegalArgumentException.class)
public void invalidTagRangeThrows() {
ExtensionsElement.create(Integer.MIN_VALUE, 500);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'com.squareup.protoparser.ProtoParser' for the... | ```java
@Test(expected = IllegalStateException.class)
public void invalidHexStringEscape() throws Exception {
String proto = "" + "message Foo {\n" + " optional string name = 1 " + "[default = \"\\xW\"];\n" + "}";
ProtoParser.parse("foo.proto", proto);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'com.squareup.protoparser.ProtoParser' for the... | ```java
@Test(expected = IllegalStateException.class)
public void serviceTypesMustBeNamed() {
String proto = "" + "service SearchService {\n" + " rpc Search (string) returns (SearchResponse);" + "}";
ProtoParser.parse("test.proto", proto);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.EnumElement$Builder'... | ```java
@Test(expected = NullPointerException.class)
public void nameRequired() {
EnumElement.builder().qualifiedName("Test").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'name' in class 'com.squareup.protoparser.EnumElement$Builder' ... | ```java
@Test(expected = NullPointerException.class)
public void nullBuilderValuesThrow() {
EnumElement.builder().name(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.EnumElement$Builder'... | ```java
@Test(expected = IllegalStateException.class)
public void duplicateValueTagThrows() {
EnumElement.builder().name("Enum1").qualifiedName("example.Enum").addConstant(EnumConstantElement.builder().name("VALUE1").tag(1).build()).addConstant(EnumConstantElement.builder().name("VALUE2").tag(1).build()).build();
}... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.OneOfElement$Builder... | ```java
@Test(expected = NullPointerException.class)
public void nameRequired() {
OneOfElement.builder().build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'name' in class 'com.squareup.protoparser.OneOfElement$Builder'... | ```java
@Test(expected = NullPointerException.class)
public void nullBuilderValuesThrow() {
OneOfElement.builder().name(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'com.squareup.protoparser.ServiceElement$Build... | ```java
@Test(expected = NullPointerException.class)
public void nameRequired() {
ServiceElement.builder().qualifiedName("Test").build();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'name' in class 'com.squareup.protoparser.ServiceElement$Builde... | ```java
@Test(expected = NullPointerException.class)
public void nullBuilderValuesThrow() {
ServiceElement.builder().name(null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'ch.digitalfondue.stampo.Stampo' for the excep... | ```java
@Test(expected = ConfigurationException.class)
public void paginationMissingDirToPaginateTest() throws IOException {
try (InputOutputDirs iod = get()) {
write(iod.inputDir.resolve("content/index.html"), fromTestResource("pagination/index-recursive.html.peb"));
Stampo stampo = new Stampo(iod.... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'ch.digitalfondue.stampo.Stampo' for the exce... | ```java
@Test(expected = YamlParserException.class)
public void testYamlParserException() throws IOException {
try (InputOutputDirs iod = TestUtils.get()) {
write(iod.inputDir.resolve("configuration.yaml"), asList("wrong=yamlformat"), StandardCharsets.UTF_8);
Stampo stampo = new Stampo(iod.inputDir,... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'ch.digitalfondue.stampo.Stampo' for the excep... | ```java
@Test(expected = LayoutException.class)
public void testPebbleLayoutException() throws IOException {
try (InputOutputDirs iod = TestUtils.get()) {
createDirectories(iod.inputDir.resolve("layout"));
write(iod.inputDir.resolve("layout/index.html.peb"), asList("{{content | raw"), StandardCharse... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'ch.digitalfondue.stampo.Stampo' for the excep... | ```java
@Test(expected = LayoutException.class)
public void testFreemarkerLayoutException() throws IOException {
try (InputOutputDirs iod = TestUtils.get()) {
createDirectories(iod.inputDir.resolve("layout"));
write(iod.inputDir.resolve("layout/index.html.ftl"), asList("${content"), StandardCharsets... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'build' in class 'ch.digitalfondue.stampo.Stampo' for the excep... | ```java
@Test(expected = TemplateException.class)
public void testPebbleTemplateException() throws IOException {
try (InputOutputDirs iod = TestUtils.get()) {
write(iod.inputDir.resolve("content/index.html.peb"), asList("{{metadata"), StandardCharsets.UTF_8);
Stampo stampo = new Stampo(iod.inputDir,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.