Skip to content

Commit

Permalink
rename/remove sep methods (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdahlke authored Sep 18, 2023
1 parent 0b85cb7 commit 1c4d495
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
11 changes: 2 additions & 9 deletions src/main/java/emissary/core/Family.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
9 changes: 2 additions & 7 deletions src/test/java/emissary/core/FamilyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/emissary/util/ShortNameComparatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ private void fillList(final List<IBaseDataObject> 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<IBaseDataObject> l) {
assertEquals(this.b, l.get(0).shortName(), "Ordering of sort");
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
Expand Down

0 comments on commit 1c4d495

Please sign in to comment.