31 lines
937 B
Java
31 lines
937 B
Java
package org.gcube.spatial.data.sdi;
|
|
|
|
import static org.junit.Assert.assertFalse;
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
import org.gcube.spatial.data.clients.model.ClientInfo;
|
|
import org.gcube.spatial.data.clients.model.engine.Engine;
|
|
import org.gcube.spatial.data.clients.model.engine.Range;
|
|
import org.junit.Test;
|
|
|
|
public class Clients {
|
|
|
|
@Test
|
|
public void testRanges() {
|
|
ClientInfo gnClient=new ClientInfo("gn2-client","GeoNetwork 2","Client to communicate with GN 2","org.gcube.sdi.some.clients.Client",
|
|
new Engine(Engine.GN_ENGINE,"",new Range("1.1.0",null)));
|
|
|
|
|
|
assertFalse(new Range("1.1.0",null).supports("0.0.1"));
|
|
assertFalse(new Range(null,"3.4").supports("4.2.1"));
|
|
|
|
|
|
assertTrue(new Range("1.1.0",null).supports("2.0.1"));
|
|
assertTrue(new Range("1.1.0","2.2").supports("2.0.1"));
|
|
assertTrue(new Range("1.2",null).supports("1.2.1"));
|
|
assertTrue(new Range(null,"3.4").supports("1.2.1"));
|
|
}
|
|
|
|
|
|
}
|