File: ShortnameTest.java

package info (click to toggle)
python-schema-salad 8.9.20251102115403-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,060 kB
  • sloc: python: 19,247; cpp: 2,631; cs: 1,869; java: 1,341; makefile: 187; xml: 184; sh: 103; javascript: 46
file content (24 lines) | stat: -rw-r--r-- 1,134 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package ${package}.utils;

import org.junit.Assert;
import org.junit.Test;

public class ShortnameTest {
	@Test
	public void testShortname() {
		Assert.assertEquals(Uris.shortname(
				"file:/Users/jdidion/projects/cwlScala/target/test-classes/CommandLineTools/conformance/#anon_enum_inside_array_inside_schemadef.cwl/first/user_type_2/species/homo_sapiens"),
				"homo_sapiens");
		Assert.assertEquals(Uris.shortname(
				"file:///home/michael/cwljava/src/test/resources/org/w3id/cwl/cwl1_2/utils/valid_anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params/ncbi_build/GRCh37"),
				"GRCh37");
		// Below are from https://w3id.org/cwl/v1.2/SchemaSalad.html#Short_names
		Assert.assertEquals(Uris.shortname("http://example.com/foo"), "foo");
		Assert.assertEquals(Uris.shortname("http://example.com/#bar"), "bar");
		Assert.assertEquals(Uris.shortname("http://example.com/foo/bar"), "bar");
		Assert.assertEquals(Uris.shortname("http://example.com/foo#bar"), "bar");
		Assert.assertEquals(Uris.shortname("http://example.com/#foo/bar"), "bar");
		Assert.assertEquals(Uris.shortname("http://example.com/foo#bar/baz"), "baz");
	}

}