From 1c4d495a09e3ff1238ff8d0c320aaf4d6d376989 Mon Sep 17 00:00:00 2001 From: jpdahlke Date: Sun, 17 Sep 2023 21:32:27 -0400 Subject: [PATCH] rename/remove sep methods (#589) --- src/main/java/emissary/core/Family.java | 11 ++--------- src/test/java/emissary/core/FamilyTest.java | 9 ++------- .../java/emissary/util/ShortNameComparatorTest.java | 12 ++++++------ 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/main/java/emissary/core/Family.java b/src/main/java/emissary/core/Family.java index ba254db2e7..d01badd4b0 100644 --- a/src/main/java/emissary/core/Family.java +++ b/src/main/java/emissary/core/Family.java @@ -61,18 +61,11 @@ public Family child() { } /** - * Return the separator string from a method - */ - public static String sep() { - return SEP; - } - - /** - * Return the separator string for the specified birthorder e.g. sep(5) ==> "-att-5" + * Return the separator string for the specified birthorder e.g. getSep(5) ==> "-att-5" * * @param birthorder the number for the attachment to name */ - public static String sep(final int birthorder) { + public static String getSep(final int birthorder) { return SEP + birthorder; } diff --git a/src/test/java/emissary/core/FamilyTest.java b/src/test/java/emissary/core/FamilyTest.java index 75771569aa..43f4a3edab 100644 --- a/src/test/java/emissary/core/FamilyTest.java +++ b/src/test/java/emissary/core/FamilyTest.java @@ -10,13 +10,8 @@ class FamilyTest extends UnitTest { @Test - void testSepValue() { - assertEquals(Family.SEP + "5", Family.sep(5), "Separator birthorder appended"); - } - - @Test - void testSepAsMethod() { - assertEquals(Family.SEP, Family.sep(), "Separator birthorder appended"); + void testGetSep() { + assertEquals(Family.SEP + "5", Family.getSep(5), "Unexpected separator birthorder"); } @Test diff --git a/src/test/java/emissary/util/ShortNameComparatorTest.java b/src/test/java/emissary/util/ShortNameComparatorTest.java index bc3ea40af4..99a310b4d8 100644 --- a/src/test/java/emissary/util/ShortNameComparatorTest.java +++ b/src/test/java/emissary/util/ShortNameComparatorTest.java @@ -41,10 +41,10 @@ private void fillList(final List l) { l.add(DataObjectFactory.getInstance(this.nobytes, this.ba + "1")); l.add(DataObjectFactory.getInstance(this.nobytes, this.ba + "3")); l.add(DataObjectFactory.getInstance(this.nobytes, this.b)); - l.add(DataObjectFactory.getInstance(this.nobytes, this.ba + "3" + Family.sep(2))); - l.add(DataObjectFactory.getInstance(this.nobytes, this.ba + "3" + Family.sep(1))); + l.add(DataObjectFactory.getInstance(this.nobytes, this.ba + "3" + Family.getSep(2))); + l.add(DataObjectFactory.getInstance(this.nobytes, this.ba + "3" + Family.getSep(1))); l.add(DataObjectFactory.getInstance(this.nobytes, this.ba + "2")); - l.add(DataObjectFactory.getInstance(this.nobytes, this.ba + "3" + Family.sep(1) + Family.sep(1))); + l.add(DataObjectFactory.getInstance(this.nobytes, this.ba + "3" + Family.getSep(1) + Family.getSep(1))); } private void checkList(final List l) { @@ -52,9 +52,9 @@ private void checkList(final List l) { assertEquals(this.ba + "1", l.get(1).shortName(), "Ordering of sort"); assertEquals(this.ba + "2", l.get(2).shortName(), "Ordering of sort"); assertEquals(this.ba + "3", l.get(3).shortName(), "Ordering of sort"); - assertEquals(this.ba + "3" + Family.sep(1), l.get(4).shortName(), "Ordering of sort"); - assertEquals(this.ba + "3" + Family.sep(1) + Family.sep(1), l.get(5).shortName(), "Ordering of sort"); - assertEquals(this.ba + "3" + Family.sep(2), l.get(6).shortName(), "Ordering of sort"); + assertEquals(this.ba + "3" + Family.getSep(1), l.get(4).shortName(), "Ordering of sort"); + assertEquals(this.ba + "3" + Family.getSep(1) + Family.getSep(1), l.get(5).shortName(), "Ordering of sort"); + assertEquals(this.ba + "3" + Family.getSep(2), l.get(6).shortName(), "Ordering of sort"); } @Test