### Question:
S3ProtocolHandler implements ProtocolHandler { @Override public String getAccessorClassName(RequestContext context) { String accessor = context.getAccessor(); if (useS3Select(context)) { accessor = S3SelectAccessor.class.getName(); } LOG.debug("Determined to use {} accessor", accessor); return accessor; }  @Override String getFragmenterClassName(RequestContext context); @Override String getAccessorClassName(RequestContext context); @Override String getResolverClassName(RequestContext context); static final String S3_SELECT_OPTION; }### Answer:
@Test public void testTextSelectOptionMissing() { context.setFormat("CSV"); context.setOutputFormat(OutputFormat.TEXT); assertEquals("default-accessor", handler.getAccessorClassName(context)); }
@Test public void testSelectInvalid() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Invalid value 'foo' for S3_SELECT option"); context.setFormat("CSV"); context.addOption("S3_SELECT", "foo"); handler.getAccessorClassName(context); }
@Test public void testSelectOnMissingFormat() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("S3_SELECT optimization is not supported for format 'null'"); context.addOption("S3_SeLeCt", "on"); handler.getAccessorClassName(context); }
@Test public void testSelectOnUnsupportedFormat() { thrown.expect(RuntimeException.class); thrown.expectMessage("S3_SELECT optimization is not supported for format 'CUSTOM'"); context.addOption("S3_SELECT", "on"); context.setFormat("custom"); handler.getAccessorClassName(context); }