Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

RepositoryServletProxiedMetadataLocalOnlyTest.java 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. package org.apache.archiva.webdav;
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. import org.junit.After;
  21. import org.junit.Before;
  22. import org.junit.Test;
  23. /**
  24. * RepositoryServlet Tests, Proxied, Get of Metadata, exists on local managed repository only.
  25. *
  26. *
  27. */
  28. public class RepositoryServletProxiedMetadataLocalOnlyTest
  29. extends AbstractRepositoryServletProxiedMetadataTestCase
  30. {
  31. @Before
  32. public void setup()
  33. throws Exception
  34. {
  35. super.setUp();
  36. }
  37. @After
  38. @Override
  39. public void tearDown()
  40. throws Exception
  41. {
  42. super.tearDown();
  43. }
  44. @Test
  45. public void testGetProxiedSnapshotVersionMetadataLocalOnly()
  46. throws Exception
  47. {
  48. // --- Setup
  49. setupSnapshotsRemoteRepo();
  50. setupPrivateSnapshotsRemoteRepo();
  51. setupCleanInternalRepo();
  52. String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/maven-metadata.xml";
  53. String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
  54. "4.0-alpha-1-SNAPSHOT" );
  55. populateRepo( repoRootInternal, path, expectedMetadata );
  56. setupConnector( REPOID_INTERNAL, remoteSnapshots );
  57. setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
  58. // --- Execution
  59. String actualMetadata = requestMetadataOK( path );
  60. // --- Verification
  61. assertExpectedMetadata( expectedMetadata, actualMetadata );
  62. }
  63. @Test
  64. public void testGetProxiedVersionMetadataLocalOnly()
  65. throws Exception
  66. {
  67. // --- Setup
  68. setupSnapshotsRemoteRepo();
  69. setupPrivateSnapshotsRemoteRepo();
  70. setupCleanInternalRepo();
  71. String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-2/maven-metadata.xml";
  72. String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
  73. "4.0-alpha-2" );
  74. populateRepo( repoRootInternal, path, expectedMetadata );
  75. // --- Execution
  76. String actualMetadata = requestMetadataOK( path );
  77. // --- Verification
  78. assertExpectedMetadata( expectedMetadata, actualMetadata );
  79. }
  80. @Test
  81. public void testGetProxiedProjectMetadataLocalOnly()
  82. throws Exception
  83. {
  84. // --- Setup
  85. setupSnapshotsRemoteRepo();
  86. setupPrivateSnapshotsRemoteRepo();
  87. setupCleanInternalRepo();
  88. String path = "org/apache/archiva/archivatest-maven-plugin/maven-metadata.xml";
  89. String version = "1.0-alpha-4";
  90. String release = "1.0-alpha-4";
  91. String expectedMetadata = createProjectMetadata( "org.apache.archiva", "archivatest-maven-plugin", version,
  92. release, new String[] { "1.0-alpha-4" } );
  93. populateRepo( repoRootInternal, path, expectedMetadata );
  94. // --- Execution
  95. String actualMetadata = requestMetadataOK( path );
  96. // --- Verification
  97. assertExpectedMetadata( expectedMetadata, actualMetadata );
  98. }
  99. @Test
  100. public void testGetProxiedGroupMetadataLocalOnly()
  101. throws Exception
  102. {
  103. // --- Setup
  104. setupSnapshotsRemoteRepo();
  105. setupPrivateSnapshotsRemoteRepo();
  106. setupCleanInternalRepo();
  107. String path = "org/apache/archiva/maven-metadata.xml";
  108. String expectedMetadata = createGroupMetadata( "org.apache.archiva", new String[] { "archivatest-maven-plugin" } );
  109. populateRepo( repoRootInternal, path, expectedMetadata );
  110. // --- Execution
  111. String actualMetadata = requestMetadataOK( path );
  112. // --- Verification
  113. assertExpectedMetadata( expectedMetadata, actualMetadata );
  114. }
  115. }