VuforialUtilTest.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import com.izouma.awesomeadmin.service.UserInfoService;
  2. import com.izouma.awesomeadmin.vuforia.VuforiaUtil;
  3. import org.junit.Test;
  4. import org.junit.runner.RunWith;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.test.context.ContextConfiguration;
  7. import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
  8. import org.springframework.test.context.support.GenericXmlContextLoader;
  9. import org.springframework.transaction.annotation.Transactional;
  10. @RunWith(value = SpringJUnit4ClassRunner.class)
  11. @ContextConfiguration(locations = {"classpath:/spring/applicationContext.xml"}, loader = GenericXmlContextLoader.class)
  12. @Transactional
  13. public class VuforialUtilTest {
  14. @Test
  15. public void PostNewTargetTest() {
  16. String imageUrl = "http://oss.izouma.com/yimishijie/images/2018-12-06-09-32-37-gr89k16u.jpg";
  17. String targetName = "ceshiadd1";
  18. double width = 30.0;
  19. String accessKey = "391531184ed5cf0d998a91f193eddd57cff3b074";
  20. String secretKey = "21f5b1d95a537e501ed62baad256f44f2b1ea022";
  21. String targetId = VuforiaUtil.PostNewTarget(imageUrl, targetName, width, accessKey, secretKey);
  22. System.out.println(targetId);
  23. }
  24. @Test
  25. public void UpdateTargetTest() {
  26. String targetName = "ceshiadd2";
  27. double width = 20.0;
  28. String accessKey = "391531184ed5cf0d998a91f193eddd57cff3b074";
  29. String secretKey = "21f5b1d95a537e501ed62baad256f44f2b1ea022";
  30. String targetId = "8761cf50dc9b4e198b608c3cac8d6f27";
  31. String result_code = VuforiaUtil.updateTarget(targetId, targetName, width, null, accessKey, secretKey);
  32. System.out.println(result_code);
  33. }
  34. }