diff options
author | Jon Bratseth <jonbratseth@yahoo.com> | 2017-01-17 14:16:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-17 14:16:32 +0100 |
commit | 7c136a06e1a792a1147417db02d7999290bb945a (patch) | |
tree | 23c65a0422bf1499f9f8dfb6f0b50c4859498d5c /config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java | |
parent | ae39567b503c746f68e04ba5b7a1aa64467fdd29 (diff) |
Revert "Revert "Revert "Revert "Bratseth/tensor type info in documents""""
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java index f8fe979c866..5542c1ce5e9 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/NameFieldCheckTestCase.java @@ -6,14 +6,16 @@ import org.junit.Test; import java.io.IOException; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; + /** * Tests that "name" is not allowed as name for a field. * * And that duplicate names are not allowed. * - * @author <a href="mailto:larschr@yahoo-inc.com">Lars Christian Jensen</a> + * @author Lars Christian Jensen */ public class NameFieldCheckTestCase extends SearchDefinitionTestCase { @@ -22,8 +24,8 @@ public class NameFieldCheckTestCase extends SearchDefinitionTestCase { try { SearchBuilder.buildFromFile("src/test/examples/name-check.sd"); fail("Should throw exception."); - } catch (Exception e) { - e.printStackTrace(); + } catch (Exception expected) { + // Success } } @@ -33,8 +35,7 @@ public class NameFieldCheckTestCase extends SearchDefinitionTestCase { SearchBuilder.buildFromFile("src/test/examples/duplicatenamesinsearchdifferenttype.sd"); fail("Should throw exception."); } catch (Exception e) { - e.printStackTrace(); - assertTrue(e.getMessage().matches(".*Duplicate.*different type.*")); + assertEquals("For search 'duplicatenamesinsearch', field 'grpphotoids64': Incompatible types. Expected Array<long> for index field 'grpphotoids64', got string.", e.getMessage()); } } @@ -44,7 +45,6 @@ public class NameFieldCheckTestCase extends SearchDefinitionTestCase { SearchBuilder.buildFromFile("src/test/examples/duplicatenamesindoc.sd"); fail("Should throw exception."); } catch (Exception e) { - e.printStackTrace(); assertTrue(e.getMessage().matches(".*Duplicate.*")); } } |