Dust off JMX demo

This commit is contained in:
dsyer
2008-07-05 07:32:44 +00:00
parent 086fded0cf
commit 3d78c0bcb5
20 changed files with 120 additions and 84 deletions

View File

@@ -71,6 +71,13 @@ public class DefaultFieldSet implements FieldSet {
}
return (String[]) names.toArray();
}
/* (non-Javadoc)
* @see org.springframework.batch.item.file.mapping.FieldSet#hasNames()
*/
public boolean hasNames() {
return names!=null;
}
/*
* (non-Javadoc)

View File

@@ -40,6 +40,13 @@ public interface FieldSet {
*/
String[] getNames();
/**
* Check if there are names defined for the fields.
*
* @return true if there are names for the fields
*/
boolean hasNames();
/**
* @return fields wrapped by this '<code>FieldSet</code>' instance as
* String values.

View File

@@ -45,11 +45,13 @@ public class FieldSetTests extends TestCase {
}
public void testNames() throws Exception {
assertTrue(fieldSet.hasNames());
assertEquals(fieldSet.getFieldCount(), fieldSet.getNames().length);
}
public void testNamesNotKnown() throws Exception {
fieldSet = new DefaultFieldSet(new String[] { "foo" });
assertFalse(fieldSet.hasNames());
try {
fieldSet.getNames();
fail("Expected IllegalStateException");