mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
29 lines
545 B
Java
29 lines
545 B
Java
package org.tests.unitinternal;
|
|
|
|
import org.junit.Assert;
|
|
import org.junit.Test;
|
|
|
|
|
|
public class TestBasics {
|
|
|
|
|
|
private String parentPath(String path) {
|
|
|
|
int pos = path.lastIndexOf('.');
|
|
if (pos == -1) {
|
|
return null;
|
|
} else {
|
|
return path.substring(0, pos);
|
|
}
|
|
}
|
|
|
|
@Test
|
|
public void testParentPath() {
|
|
|
|
Assert.assertTrue((parentPath("banana") == null));
|
|
Assert.assertTrue((parentPath("banana.apple").equals("banana")));
|
|
Assert.assertTrue((parentPath("banana.apple.o").equals("banana.apple")));
|
|
|
|
}
|
|
}
|