mirror of https://github.com/apache/archiva.git
[MRM-1362] Add simple 'CRUD' pages for project-level metadata along with a "generic metadata" plugin
o do not show add property widget if user does not have repository manager role o added selenium test for browsing metadata if user is not a repository manager git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@953612 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8f1414a1dc
commit
a72aeb4d5e
|
@ -159,6 +159,42 @@ public class BrowseTest
|
||||||
|
|
||||||
@Test( dependsOnMethods = { "testAddMetadataPropertyEmpty" } )
|
@Test( dependsOnMethods = { "testAddMetadataPropertyEmpty" } )
|
||||||
public void testAddMetadataProperty()
|
public void testAddMetadataProperty()
|
||||||
|
{
|
||||||
|
addMetadataProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test( dependsOnMethods = { "testAddMetadataProperty" } )
|
||||||
|
public void testDeleteMetadataProperty()
|
||||||
|
{
|
||||||
|
deleteMetadataProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test( dependsOnMethods = { "testDeleteMetadataProperty" })
|
||||||
|
public void testMetadataAccessWithRepositoryObserverRole()
|
||||||
|
{
|
||||||
|
addMetadataProperty();
|
||||||
|
|
||||||
|
logout();
|
||||||
|
|
||||||
|
goToBrowsePage();
|
||||||
|
clickLinkWithText( getProperty( "ARTIFACT_GROUPID" ) + "/" );
|
||||||
|
clickLinkWithText( getProperty( "ARTIFACT_ARTIFACTID" ) + "/" );
|
||||||
|
clickLinkWithText( getProperty( "ARTIFACT_VERSION" ) + "/" );
|
||||||
|
clickLinkWithText( "Metadata" );
|
||||||
|
|
||||||
|
waitPage();
|
||||||
|
|
||||||
|
assertTextNotPresent( "No metadata content." );
|
||||||
|
assertButtonWithValueNotPresent( "Add" );
|
||||||
|
assertTextNotPresent( "Add Property" );
|
||||||
|
assertImgWithAltNotPresent( "Delete" );
|
||||||
|
|
||||||
|
login( getAdminUsername(), getAdminPassword() );
|
||||||
|
|
||||||
|
deleteMetadataProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addMetadataProperty()
|
||||||
{
|
{
|
||||||
goToBrowsePage();
|
goToBrowsePage();
|
||||||
clickLinkWithText( getProperty( "ARTIFACT_GROUPID" ) + "/" );
|
clickLinkWithText( getProperty( "ARTIFACT_GROUPID" ) + "/" );
|
||||||
|
@ -168,6 +204,7 @@ public class BrowseTest
|
||||||
|
|
||||||
assertTextPresent( "No metadata content." );
|
assertTextPresent( "No metadata content." );
|
||||||
assertButtonWithValuePresent( "Add" );
|
assertButtonWithValuePresent( "Add" );
|
||||||
|
assertTextPresent( "Add Property" );
|
||||||
|
|
||||||
setFieldValue( "propertyName", "foo" );
|
setFieldValue( "propertyName", "foo" );
|
||||||
setFieldValue( "propertyValue", "bar" );
|
setFieldValue( "propertyValue", "bar" );
|
||||||
|
@ -180,8 +217,7 @@ public class BrowseTest
|
||||||
assertTextPresent( "foo=bar" );
|
assertTextPresent( "foo=bar" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test( dependsOnMethods = { "testAddMetadataProperty" } )
|
private void deleteMetadataProperty()
|
||||||
public void testDeleteMetadataProperty()
|
|
||||||
{
|
{
|
||||||
goToBrowsePage();
|
goToBrowsePage();
|
||||||
clickLinkWithText( getProperty( "ARTIFACT_GROUPID" ) + "/" );
|
clickLinkWithText( getProperty( "ARTIFACT_GROUPID" ) + "/" );
|
||||||
|
@ -191,6 +227,7 @@ public class BrowseTest
|
||||||
|
|
||||||
assertTextPresent( "foo=bar" );
|
assertTextPresent( "foo=bar" );
|
||||||
assertButtonWithValuePresent( "Add" );
|
assertButtonWithValuePresent( "Add" );
|
||||||
|
assertTextPresent( "Add Property" );
|
||||||
|
|
||||||
clickImgWithAlt( "Delete" );
|
clickImgWithAlt( "Delete" );
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,10 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<div id="effect" class="ui-widget-content ui-corner-all">
|
<redback:ifAuthorized permission="archiva-add-metadata" resource="${repositoryId}">
|
||||||
<h3 class="ui-widget-header ui-corner-all">Add Property</h3>
|
<div id="effect" class="ui-widget-content ui-corner-all">
|
||||||
<redback:ifAuthorized permission="archiva-add-metadata" resource="${repositoryId}">
|
<h3 class="ui-widget-header ui-corner-all">Add Property</h3>
|
||||||
|
|
||||||
<s:form action="addMetadataProperty" namespace="/" method="post" validate="true" theme="simple">
|
<s:form action="addMetadataProperty" namespace="/" method="post" validate="true" theme="simple">
|
||||||
<s:hidden name="groupId" value="%{groupId}" />
|
<s:hidden name="groupId" value="%{groupId}" />
|
||||||
<s:hidden name="artifactId" value="%{artifactId}" />
|
<s:hidden name="artifactId" value="%{artifactId}" />
|
||||||
|
@ -51,8 +52,8 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</s:form>
|
</s:form>
|
||||||
</redback:ifAuthorized>
|
</div>
|
||||||
</div>
|
</redback:ifAuthorized>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<c:if test="${empty genericMetadata}">
|
<c:if test="${empty genericMetadata}">
|
||||||
|
|
Loading…
Reference in New Issue