本文整理汇总了Java中org.lappsgrid.metadata.ServiceMetadata类的典型用法代码示例。如果您正苦于以下问题:Java ServiceMetadata类的具体用法?Java ServiceMetadata怎么用?Java ServiceMetadata使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServiceMetadata类属于org.lappsgrid.metadata包,在下文中一共展示了ServiceMetadata类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMetadata
import org.lappsgrid.metadata.ServiceMetadata; //导入依赖的package包/类
@Override
public String getMetadata()
{
if (metadata == null)
{
ServiceMetadata md = new ServiceMetadataBuilder()
.name("TCF Converter")
.vendor("http://www.lappsgrid.org")
.description("Converts TCF into LIF")
.license("The TCF to LIF converter is available under the `Apache 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`_ license.")
.requireFormat(Uri.TCF)
.produceFormat(Uri.LIF)
.build();
metadata = new Data(Uri.META, md).asPrettyJson();
}
return metadata;
}
开发者ID:lappsgrid-services,项目名称:org.lappsgrid.converters.tcf.service,代码行数:18,代码来源:TCFConverterService.java
示例2: testMetadata
import org.lappsgrid.metadata.ServiceMetadata; //导入依赖的package包/类
@Test
public void testMetadata()
{
// service = new SentenceSplitter();
String json = service.getMetadata();
Data<Map> data = Serializer.parse(json, Data.class);
System.out.println(data.getDiscriminator());
ServiceMetadata metadata = new ServiceMetadata(data.getPayload());
assertEquals(metadata.getVersion(), Version.getVersion());
assertEquals(metadata.getVendor(), "http://www.anc.org");
assertEquals(metadata.getName(), SentenceSplitter.class.getCanonicalName());
// System.out.println(data.getPayload());
assertTrue(data.getPayload().toString(), Uri.META.equals(data.getDiscriminator()));
// ServiceMetadata metadata = new ServiceMetadata(data.getPayload());
// System.out.println(metadata.toPrettyJson());
}
示例3: testGateToJsonMetadata
import org.lappsgrid.metadata.ServiceMetadata; //导入依赖的package包/类
@Test
public void testGateToJsonMetadata() {
System.out.println("MetadataTests.testGateToJsonMetadata");
WebService service = new GateToJsonConverter();
String json = service.getMetadata();
assertNotNull(json);
Data<Object> data = Serializer.parse(json, Data.class);
check(data.getPayload().toString(), Uri.META, data.getDiscriminator());
ServiceMetadata metadata = new ServiceMetadata((Map)data.getPayload());
checkCommonMetadata(metadata, GateToJsonConverter.class);
List<String> list = metadata.getRequires().getFormat();
assertTrue("Requires format is empty.", list.size() > 0);
String format = list.get(0);
check(Uri.GATE, format);
list = metadata.getProduces().getFormat();
assertTrue("Produces format is empty.", list.size() > 0);
check(Uri.LAPPS, list.get(0));
}
示例4: testJsonToGateMetadata
import org.lappsgrid.metadata.ServiceMetadata; //导入依赖的package包/类
@Test
public void testJsonToGateMetadata()
{
System.out.println("MetadataTests.testJsonToGateMetadata");
WebService service = new JsonToGateConverter();
String json = service.getMetadata();
assertNotNull(json);
Data<Object> data = Serializer.parse(json, Data.class);
check(data.getPayload().toString(), Uri.META, data.getDiscriminator());
ServiceMetadata metadata = new ServiceMetadata((Map)data.getPayload());
checkCommonMetadata(metadata, JsonToGateConverter.class);
List<String> list = metadata.getRequires().getFormat();
assertTrue("Requires format is empty.", list.size() > 0);
String format = list.get(0);
check(Uri.LAPPS, format);
list = metadata.getProduces().getFormat();
assertTrue("Produces format is empty.", list.size() > 0);
check(Uri.GATE, list.get(0));
}
示例5: check
import org.lappsgrid.metadata.ServiceMetadata; //导入依赖的package包/类
private void check(Class<? extends WebService> serviceClass) throws IllegalAccessException, InstantiationException
{
System.out.println("Validating " + serviceClass.getCanonicalName());
WebService service = serviceClass.newInstance();
String json = service.getMetadata();
assertNotNull(json);
Data<Map> data = Serializer.parse(json, Data.class);
assertEquals(data.getDiscriminator(), Uri.META);
validate(data.asJson());
ServiceMetadata metadata = new ServiceMetadata(data.getPayload());
assertNotNull(metadata);
assertEquals(metadata.getVersion(), Version.getVersion());
assertEquals(metadata.getVendor(), "http://www.anc.org");
assertEquals(metadata.getName(), serviceClass.getCanonicalName());
}
示例6: checkCommonMetadata
import org.lappsgrid.metadata.ServiceMetadata; //导入依赖的package包/类
protected void checkCommonMetadata(ServiceMetadata metadata, Class<?> theClass)
{
check(Uri.ANY, metadata.getAllow());
check("http://www.anc.org", metadata.getVendor());
check(Version.getVersion(), metadata.getVersion());
check(theClass.getCanonicalName(), metadata.getName());
}