test.com.generationjava.util.StringJoinerTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gj-core Show documentation
Show all versions of gj-core Show documentation
A re-usable library of Java classes. Originally stand-alone, many of the classes have since gone into various parts of the Jakarta Commons project, and thus this package contains various dependencies.
The newest version!
package com.generationjava.util;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
public class StringJoinerTest extends TestCase {
public StringJoinerTest(String name) {
super(name);
}
//-----------------------------------------------------------------------
// To test:
// StringJoiner(String, String) -> join(String[])
public void testJoin() {
StringJoiner joiner = new StringJoiner("? ? ", "?");
assertEquals("one two ", joiner.join(new String[] { "one", "two" }));
assertEquals("1 2 ", joiner.join(new String[] { "1", "2" }));
assertEquals("uno dos ", joiner.join(new String[] { "uno", "dos" }));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy