DomGarguilo opened a new pull request #2435:
URL: https://github.com/apache/accumulo/pull/2435
The goal of this PR is to convert all usage of the older `@Test(expected =
...` form of exception testing to the newer `assertThrows()`.
An example conversion:
```java
@Test(expected = IllegalArgumentException.class)
public void testNegativeTimeout() {
BatchWriterConfig bwConfig = new BatchWriterConfig();
bwConfig.setTimeout(-1, TimeUnit.DAYS);
}
```
Would become:
```java
@Test
public void testNegativeTimeout() {
BatchWriterConfig bwConfig = new BatchWriterConfig();
assertThrows(IllegalArgumentException.class, () ->
bwConfig.setTimeout(-1, TimeUnit.DAYS));
}
```
I used this command to verify all tests that were changed still pass:
`mvn clean verify
-Dit.test=ConditionalWriterIT,ReadWriteIT,KerberosIT,MetaConstraintRetryIT,ShellServerIT,BulkNewIT,ZooKeeperPropertiesIT,AccumuloInputFormatIT,NewTableConfigurationIT,MetaSplitIT,CloneTestIT
-Dtest=ZooReaderWriterTest,TabletMetadataTest,TCredentialsUpdatingInvocationHandlerTest,AuthorizationsTest,FastFormatTest,ReplicationProcessorTest,TabletLocationStateTest,RelativeKeyTest,InMemoryMapTest,GarbageCollectionTest,OpTimerTest,ConfigCheckUtilTest,ScannerOptionsTest,ConfigurationTypeHelperTest,LogFileKeyTest,DefaultFormatterTest,SortedMapIteratorTest,TabletServerSyncCheckTest,LoadPlanTest,MetadataTimeTest,Upgrader9to10Test,ZooAuthenticationKeyDistributorTest,AuthenticationTokenSecretManagerTest,MutationTest,AccumuloConfigurationTest,ArrayByteSequenceTest,ListLexicoderTest,HadoopCredentialProviderTest,WholeRowIteratorTest,ConditionTest,ProblemReportingIteratorTest,UnsynchronizedBufferTest,TabletTimeTest,ManagerReplicationCoordinatorTest,IteratorSettingTest,TabletMutat
ionPrepAttemptTest,ZooSessionTest,ValueTest,TServerUtilsTest,SpaceAwareVolumeChooserTest,RFileTest,BatchWriterConfigTest,LinkingIteratorTest,HexFormatterTest,RFileClientTest,CredentialProviderTokenTest,PasswordConverterTest,ReplicationSchemaTest,ServerContextTest,DelegationTokenConfigTest,KeyTest,ThriftTransportKeyTest,SequenceLexicoderTest,AccumuloTest,AuthenticationKeyTest,RowEncodingIteratorTest,ShellUtilTest,ZooKeeperInstanceTest
-Dspotbugs.skip -Dtimeout.factor=1`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]