Renamed the PresetTest helper class to PresetAssertHelper. This keeps ant unittest...
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Tue, 8 May 2012 18:13:52 +0000 (18:13 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Tue, 8 May 2012 18:13:52 +0000 (18:13 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@655 180e2498-e6e9-4542-8430-84ac67f01cd8

12 files changed:
core/test/net/sf/openrocket/preset/BodyTubePresetTests.java
core/test/net/sf/openrocket/preset/BulkHeadPresetTests.java
core/test/net/sf/openrocket/preset/CenteringRingPresetTests.java
core/test/net/sf/openrocket/preset/EngineBlockPresetTests.java
core/test/net/sf/openrocket/preset/LaunchLugPresetTests.java
core/test/net/sf/openrocket/preset/NoseConePresetTests.java
core/test/net/sf/openrocket/preset/ParachutePresetTests.java
core/test/net/sf/openrocket/preset/PresetAssertHelper.java [new file with mode: 0644]
core/test/net/sf/openrocket/preset/PresetTest.java [deleted file]
core/test/net/sf/openrocket/preset/StreamerPresetTests.java
core/test/net/sf/openrocket/preset/TransitionPresetTests.java
core/test/net/sf/openrocket/preset/TubeCouplerPresetTests.java

index 9e4ddf0e814f71a138186d28ef194ff77b90c267..9d63798502e5d738db630db54bd1647e8ebbfe0e 100644 (file)
@@ -24,7 +24,7 @@ public class BodyTubePresetTests {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.BODY_TUBE);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -48,7 +48,7 @@ public class BodyTubePresetTests {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.LENGTH
@@ -71,7 +71,7 @@ public class BodyTubePresetTests {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LENGTH
                        },
@@ -94,7 +94,7 @@ public class BodyTubePresetTests {
                        presetspec.put( ComponentPreset.OUTER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -114,7 +114,7 @@ public class BodyTubePresetTests {
                        presetspec.put( ComponentPreset.INNER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -134,7 +134,7 @@ public class BodyTubePresetTests {
                        presetspec.put( ComponentPreset.THICKNESS, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
index 0cbfd28c18edffc0c403ba93c499a8034d18b39b..ec2718fbc85728606263f3e02cc568d35ef427a9 100644 (file)
@@ -24,7 +24,7 @@ public class BulkHeadPresetTests {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.BULK_HEAD);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -49,7 +49,7 @@ public class BulkHeadPresetTests {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.LENGTH,
@@ -73,7 +73,7 @@ public class BulkHeadPresetTests {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LENGTH,
                                        ComponentPreset.OUTER_DIAMETER
@@ -96,7 +96,7 @@ public class BulkHeadPresetTests {
                        presetspec.put( ComponentPreset.LENGTH, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.OUTER_DIAMETER
                        },
index 109d15e5e2a95c7546b4c0a202517f15fc766874..d378668c62ce63aae2839e6ff29946562fba2257 100644 (file)
@@ -24,7 +24,7 @@ public class CenteringRingPresetTests {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.CENTERING_RING);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -48,7 +48,7 @@ public class CenteringRingPresetTests {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.LENGTH
@@ -71,7 +71,7 @@ public class CenteringRingPresetTests {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LENGTH
                        },
@@ -94,7 +94,7 @@ public class CenteringRingPresetTests {
                        presetspec.put( ComponentPreset.OUTER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -114,7 +114,7 @@ public class CenteringRingPresetTests {
                        presetspec.put( ComponentPreset.INNER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -134,7 +134,7 @@ public class CenteringRingPresetTests {
                        presetspec.put( ComponentPreset.THICKNESS, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
index 0c6ebf01fea8eb31338f2fc1aed9cd5593da1ea9..420a22d74afe6b6697df27a2bf0452e8bbcb9bef 100644 (file)
@@ -24,7 +24,7 @@ public class EngineBlockPresetTests {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.ENGINE_BLOCK);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -48,7 +48,7 @@ public class EngineBlockPresetTests {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.LENGTH
@@ -71,7 +71,7 @@ public class EngineBlockPresetTests {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LENGTH
                        },
@@ -94,7 +94,7 @@ public class EngineBlockPresetTests {
                        presetspec.put( ComponentPreset.OUTER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -114,7 +114,7 @@ public class EngineBlockPresetTests {
                        presetspec.put( ComponentPreset.INNER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -134,7 +134,7 @@ public class EngineBlockPresetTests {
                        presetspec.put( ComponentPreset.THICKNESS, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
index d2707f03bc8ff18358e30a0b8c582cd79c06a8af..42793a3e33f891f645920109d4d9a1d19dcc4c35 100644 (file)
@@ -24,7 +24,7 @@ public class LaunchLugPresetTests {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.LAUNCH_LUG);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -48,7 +48,7 @@ public class LaunchLugPresetTests {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.LENGTH
@@ -71,7 +71,7 @@ public class LaunchLugPresetTests {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LENGTH
                        },
@@ -94,7 +94,7 @@ public class LaunchLugPresetTests {
                        presetspec.put( ComponentPreset.OUTER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -114,7 +114,7 @@ public class LaunchLugPresetTests {
                        presetspec.put( ComponentPreset.INNER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -134,7 +134,7 @@ public class LaunchLugPresetTests {
                        presetspec.put( ComponentPreset.THICKNESS, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
index f82b59189633116e2f14e1b8841a7d81b656d475..6a6368a274cef09b9bef22cf07a80396fb2c6713 100644 (file)
@@ -26,7 +26,7 @@ public class NoseConePresetTests extends BaseTestCase {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.NOSE_CONE);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -53,7 +53,7 @@ public class NoseConePresetTests extends BaseTestCase {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.LENGTH,
@@ -79,7 +79,7 @@ public class NoseConePresetTests extends BaseTestCase {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LENGTH,
                                        ComponentPreset.AFT_OUTER_DIAMETER,
@@ -104,7 +104,7 @@ public class NoseConePresetTests extends BaseTestCase {
                        presetspec.put( ComponentPreset.LENGTH, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.AFT_OUTER_DIAMETER,
                                        ComponentPreset.SHAPE
@@ -128,7 +128,7 @@ public class NoseConePresetTests extends BaseTestCase {
                        presetspec.put( ComponentPreset.SHAPE, Transition.Shape.CONICAL);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.AFT_OUTER_DIAMETER
                        },
index ad9556990efb00f10ac4f734548168174fee3ff7..e6b3110a31ee4434a64f5d58f94824615b12e8dd 100644 (file)
@@ -22,7 +22,7 @@ public class ParachutePresetTests {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.PARACHUTE);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -49,7 +49,7 @@ public class ParachutePresetTests {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.DIAMETER,
@@ -75,7 +75,7 @@ public class ParachutePresetTests {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.DIAMETER,
                                        ComponentPreset.LINE_COUNT,
@@ -100,7 +100,7 @@ public class ParachutePresetTests {
                        presetspec.put( ComponentPreset.DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LINE_COUNT,
                                        ComponentPreset.LINE_LENGTH
@@ -124,7 +124,7 @@ public class ParachutePresetTests {
                        presetspec.put( ComponentPreset.LINE_COUNT, 6);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LINE_LENGTH
                        },
diff --git a/core/test/net/sf/openrocket/preset/PresetAssertHelper.java b/core/test/net/sf/openrocket/preset/PresetAssertHelper.java
new file mode 100644 (file)
index 0000000..84b7c03
--- /dev/null
@@ -0,0 +1,43 @@
+package net.sf.openrocket.preset;
+
+import static org.junit.Assert.*;
+
+public abstract class PresetAssertHelper {
+
+       public static void assertInvalidPresetException( InvalidComponentPresetException exceptions, TypedKey<?>[] keys, String[] messages ) {
+               if ( keys != null ) {
+                       assertEquals( keys.length, exceptions.getInvalidParameters().size() );
+                       for( TypedKey<?> expectedKey : keys ) {
+                               boolean keyFound = false;
+                               for( TypedKey<?> k : exceptions.getInvalidParameters() ) {
+                                       if ( expectedKey == k ) {
+                                               keyFound = true;
+                                               break;
+                                       }
+                               }
+                               if ( ! keyFound ) {
+                                       fail( "Expected key " + expectedKey + " not in exception");
+                               }
+                       }
+               } else {
+                       assertEquals(0, exceptions.getInvalidParameters().size() );
+               }
+               if ( messages != null ) {
+                       assertEquals( messages.length, exceptions.getErrors().size() );
+                       for( String expectedMessage : messages ) {
+                               boolean stringMatched = false;
+                               for ( String s : exceptions.getErrors() ) {
+                                       if ( s.contains( expectedMessage ) ) {
+                                               stringMatched = true;
+                                               break;
+                                       }
+                               }
+                               if( !stringMatched ) {
+                                       fail( "Expected string \"" + expectedMessage + "\" not reported in errors");
+                               }
+                       }
+               } else {
+                       assertEquals(0, exceptions.getErrors().size() );
+               }
+       }
+}
diff --git a/core/test/net/sf/openrocket/preset/PresetTest.java b/core/test/net/sf/openrocket/preset/PresetTest.java
deleted file mode 100644 (file)
index ce42bb4..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package net.sf.openrocket.preset;
-
-import static org.junit.Assert.*;
-
-public abstract class PresetTest {
-
-       public static void assertInvalidPresetException( InvalidComponentPresetException exceptions, TypedKey<?>[] keys, String[] messages ) {
-               if ( keys != null ) {
-                       assertEquals( keys.length, exceptions.getInvalidParameters().size() );
-                       for( TypedKey<?> expectedKey : keys ) {
-                               boolean keyFound = false;
-                               for( TypedKey<?> k : exceptions.getInvalidParameters() ) {
-                                       if ( expectedKey == k ) {
-                                               keyFound = true;
-                                               break;
-                                       }
-                               }
-                               if ( ! keyFound ) {
-                                       fail( "Expected key " + expectedKey + " not in exception");
-                               }
-                       }
-               } else {
-                       assertEquals(0, exceptions.getInvalidParameters().size() );
-               }
-               if ( messages != null ) {
-                       assertEquals( messages.length, exceptions.getErrors().size() );
-                       for( String expectedMessage : messages ) {
-                               boolean stringMatched = false;
-                               for ( String s : exceptions.getErrors() ) {
-                                       if ( s.contains( expectedMessage ) ) {
-                                               stringMatched = true;
-                                               break;
-                                       }
-                               }
-                               if( !stringMatched ) {
-                                       fail( "Expected string \"" + expectedMessage + "\" not reported in errors");
-                               }
-                       }
-               } else {
-                       assertEquals(0, exceptions.getErrors().size() );
-               }
-       }
-}
index df84a4f38102bded418389cfe9ea5f57c4ea9b0b..a16fd14c7d4f45deea61d0453a1a5724df31e4b6 100644 (file)
@@ -22,7 +22,7 @@ public class StreamerPresetTests {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.STREAMER);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -47,7 +47,7 @@ public class StreamerPresetTests {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.LENGTH,
@@ -71,7 +71,7 @@ public class StreamerPresetTests {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LENGTH,
                                        ComponentPreset.WIDTH
@@ -94,7 +94,7 @@ public class StreamerPresetTests {
                        presetspec.put( ComponentPreset.LENGTH, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.WIDTH
                        },
index 45d9a1e37785f8a311b88e8558b6a560a1cf3388..321e909eb7b69fb31e680e42278449a1f5de2deb 100644 (file)
@@ -26,7 +26,7 @@ public class TransitionPresetTests extends BaseTestCase {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.TRANSITION);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -53,7 +53,7 @@ public class TransitionPresetTests extends BaseTestCase {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.LENGTH,
@@ -79,7 +79,7 @@ public class TransitionPresetTests extends BaseTestCase {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LENGTH,
                                        ComponentPreset.AFT_OUTER_DIAMETER,
@@ -105,7 +105,7 @@ public class TransitionPresetTests extends BaseTestCase {
                        presetspec.put( ComponentPreset.SHAPE, Transition.Shape.CONICAL);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.AFT_OUTER_DIAMETER,
                                        ComponentPreset.FORE_OUTER_DIAMETER
@@ -131,7 +131,7 @@ public class TransitionPresetTests extends BaseTestCase {
                        presetspec.put( ComponentPreset.AFT_OUTER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.FORE_OUTER_DIAMETER
                        },
index 296958b5818520be2f11502c97b74be94e871d09..90535a3bd7b5eb6981edec327236f2f67eaf09bb 100644 (file)
@@ -24,7 +24,7 @@ public class TubeCouplerPresetTests {
                        presetspec.put(ComponentPreset.TYPE, ComponentPreset.Type.TUBE_COUPLER);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.MANUFACTURER, 
                                        ComponentPreset.PARTNO, 
@@ -48,7 +48,7 @@ public class TubeCouplerPresetTests {
                        presetspec.put( ComponentPreset.MANUFACTURER, Manufacturer.getManufacturer("manufacturer"));
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.PARTNO, 
                                        ComponentPreset.LENGTH
@@ -71,7 +71,7 @@ public class TubeCouplerPresetTests {
                        presetspec.put( ComponentPreset.PARTNO, "partno");
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        new TypedKey<?>[] {
                                        ComponentPreset.LENGTH
                        },
@@ -94,7 +94,7 @@ public class TubeCouplerPresetTests {
                        presetspec.put( ComponentPreset.OUTER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -114,7 +114,7 @@ public class TubeCouplerPresetTests {
                        presetspec.put( ComponentPreset.INNER_DIAMETER, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"
@@ -134,7 +134,7 @@ public class TubeCouplerPresetTests {
                        presetspec.put( ComponentPreset.THICKNESS, 2.0);
                        ComponentPresetFactory.create(presetspec);
                } catch ( InvalidComponentPresetException ex ) {
-                       PresetTest.assertInvalidPresetException( ex,
+                       PresetAssertHelper.assertInvalidPresetException( ex,
                                        null,
                        new String[] {
                                        "Preset dimensions underspecified"