final TemporaryFileManager manager = new TemporaryFileManager(
new TestDeviceRepositoryCreator());
manager.executeWith(new TemporaryFileExecutor() {
public void execute(final File deviceRepositoryFile) throws Exception {
final AbstractDeviceRepositoryAccessor accessor =
createAccessor(deviceRepositoryFile);
final Locale locale = Locale.getDefault();
// Create a test connection
final RepositoryConnection connection = createConnection();
CategoryDescriptor descriptor =
accessor.retrieveCategoryDescriptor(
connection, "protocol", locale);
// Ensure the name matches as expected
assertEquals("Descriptive name should match (boolean)",
descriptor.getCategoryDescriptiveName(),
"Protocol");
descriptor = accessor.retrieveCategoryDescriptor(
connection, "audio", new Locale("de"));
// Ensure the name matches as expected
assertEquals("Descriptive name should match",
descriptor.getCategoryDescriptiveName(),
"Audiodaten");
descriptor = accessor.retrieveCategoryDescriptor(
connection, "audio", new Locale("de", "CH"));
// Ensure the name matches as expected
assertEquals("Descriptive name should match",
descriptor.getCategoryDescriptiveName(),
"Audiodaten");