Skip to content

Commit bb72e4c

Browse files
author
cogmission
committed
Add two tests
1 parent 212ac34 commit bb72e4c

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package org.numenta.nupic.datagen;
2+
3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.assertFalse;
5+
import static org.junit.Assert.assertNotNull;
6+
import static org.junit.Assert.fail;
7+
8+
import java.net.URI;
9+
10+
import org.junit.Test;
11+
12+
13+
public class ResourceLocatorTest {
14+
15+
@Test
16+
public void testURICreation() {
17+
try {
18+
ResourceLocator.uri(".");
19+
fail();
20+
}catch(Exception e) {
21+
assertEquals(IllegalStateException.class, e.getClass());
22+
assertEquals(java.net.MalformedURLException.class, e.getCause().getClass());
23+
}
24+
25+
try {
26+
URI uri = ResourceLocator.uri("file:///.");
27+
assertNotNull(uri);
28+
29+
assertFalse(uri.isOpaque());
30+
}catch(Exception e) {
31+
fail();
32+
}
33+
}
34+
35+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.numenta.nupic.util;
2+
3+
import static org.junit.Assert.*;
4+
5+
import org.junit.Test;
6+
7+
8+
public class ConditionTest {
9+
10+
@Test
11+
public void testRqwAdapterReturnsFalse() {
12+
Condition.Adapter<Object> adapter = new Condition.Adapter<>();
13+
assertFalse(adapter.eval(1.0d));
14+
assertFalse(adapter.eval(1));
15+
assertFalse(adapter.eval(new Object()));
16+
}
17+
18+
}

0 commit comments

Comments
 (0)