Files
JIMRI/java/test/jmri/util/managers/OBlockManagerThrowExceptionScaffold.java
T
2026-06-17 14:00:51 +02:00

51 lines
1.4 KiB
Java

package jmri.util.managers;
import javax.annotation.Nonnull;
import jmri.jmrit.logix.OBlock;
import jmri.jmrit.logix.OBlockManager;
/**
* This manager always throws an IllegalArgumentException from provide and get methods.
* It is used for testing exception handling in tests.
*
* The class name ends with 'Scaffold' to exclude it from the coverage statistics,
* since it is part of the testing infrastructure.
*/
public class OBlockManagerThrowExceptionScaffold extends OBlockManager {
public OBlockManagerThrowExceptionScaffold() {
super();
}
/** {@inheritDoc} */
@Override
public OBlock createNewOBlock(String systemName, String userName) {
throw new IllegalArgumentException("Illegal argument");
}
/** {@inheritDoc} */
@Override
@Nonnull public OBlock provideOBlock(String name) throws IllegalArgumentException {
throw new IllegalArgumentException("Illegal argument");
}
/** {@inheritDoc} */
@Override
public OBlock getOBlock(@Nonnull String name) {
throw new IllegalArgumentException("Illegal argument");
}
/** {@inheritDoc} */
@Override
public OBlock getBySystemName(@Nonnull String name) {
throw new IllegalArgumentException("Illegal argument");
}
/** {@inheritDoc} */
@Override
public OBlock getByUserName(String key) {
throw new IllegalArgumentException("Illegal argument");
}
}