当前位置: 首页>>代码示例>>Java>>正文


Java Dataset.setLicense方法代码示例

本文整理汇总了Java中org.gbif.api.model.registry.Dataset.setLicense方法的典型用法代码示例。如果您正苦于以下问题:Java Dataset.setLicense方法的具体用法?Java Dataset.setLicense怎么用?Java Dataset.setLicense使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gbif.api.model.registry.Dataset的用法示例。


在下文中一共展示了Dataset.setLicense方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testHBaseResultRequiresUpdate

import org.gbif.api.model.registry.Dataset; //导入方法依赖的package包/类
@Test
public void testHBaseResultRequiresUpdate() {

  Organization mockPublishingOrg = getMockOrganization();
  Country publishingCountry = Country.ANTARCTICA;
  mockPublishingOrg.setCountry(publishingCountry);
  License license = License.CC0_1_0;

  Result hbaseValues = mockHBaseResult(mockPublishingOrg.getKey().toString(), publishingCountry, license);

  Dataset dataset = getMockDataset();
  dataset.setPublishingOrganizationKey(mockPublishingOrg.getKey());
  dataset.setLicense(license);
  assertFalse(OCC_MUTATOR.requiresUpdate(dataset, mockPublishingOrg, hbaseValues));

  //now change the license
  dataset.setLicense(License.CC_BY_4_0);
  assertTrue(OCC_MUTATOR.requiresUpdate(dataset, mockPublishingOrg, hbaseValues));
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:20,代码来源:RegistryBasedOccurrenceMutatorTest.java

示例2: testRequiresUpdateDataset

import org.gbif.api.model.registry.Dataset; //导入方法依赖的package包/类
@Test
public void testRequiresUpdateDataset() {

  Organization org = getMockOrganization();
  Dataset datasetBefore = getMockDataset();
  datasetBefore.setPublishingOrganizationKey(org.getKey());
  datasetBefore.setLicense(License.UNSPECIFIED);

  Dataset datasetAfter = new Dataset();
  datasetAfter.setKey(datasetBefore.getKey());
  datasetAfter.setPublishingOrganizationKey(org.getKey());
  datasetAfter.setLicense(License.CC0_1_0);

  assertTrue(OCC_MUTATOR.requiresUpdate(datasetBefore, datasetAfter));
  assertTrue(StringUtils.isNotBlank(OCC_MUTATOR.generateUpdateMessage(org, org, datasetBefore, datasetAfter)
          .orElse("")));
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:18,代码来源:RegistryBasedOccurrenceMutatorTest.java

示例3: testRequiresUpdateDatasetOrganization

import org.gbif.api.model.registry.Dataset; //导入方法依赖的package包/类
@Test
public void testRequiresUpdateDatasetOrganization() {

  UUID randomUUID = UUID.randomUUID();
  Organization orgBefore = new Organization();
  orgBefore.setKey(randomUUID);
  orgBefore.setEndorsementApproved(true);
  orgBefore.setCountry(Country.ANDORRA);

  Organization orgAfter = new Organization();
  orgAfter.setKey(randomUUID);
  orgAfter.setEndorsementApproved(true);
  orgAfter.setCountry(Country.ANGOLA);

  assertTrue(OCC_MUTATOR.requiresUpdate(orgBefore, orgAfter));

  Dataset dataset = getMockDataset();
  dataset.setPublishingOrganizationKey(orgBefore.getKey());
  dataset.setLicense(License.CC0_1_0);
  assertTrue(StringUtils.isNotBlank(OCC_MUTATOR.generateUpdateMessage(orgBefore, orgAfter, dataset, dataset)
          .orElse("")));
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:23,代码来源:RegistryBasedOccurrenceMutatorTest.java


注:本文中的org.gbif.api.model.registry.Dataset.setLicense方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。