mirror of
https://github.com/Alfresco/alfresco-sdk.git
synced 2025-05-19 17:15:24 +00:00
added amp testing framework to aio. tested remote junit working
This commit is contained in:
parent
bfd6d9ccc8
commit
8bf4214be1
@ -25,6 +25,12 @@
|
|||||||
<include>**/*.java</include>
|
<include>**/*.java</include>
|
||||||
</includes>
|
</includes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
|
<fileSet filtered="false" packaged="false" encoding="UTF-8">
|
||||||
|
<directory>src/test/java</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*.java</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
<fileSet encoding="UTF-8" filtered="false">
|
<fileSet encoding="UTF-8" filtered="false">
|
||||||
<directory>src/main/amp</directory>
|
<directory>src/main/amp</directory>
|
||||||
<includes>
|
<includes>
|
||||||
|
@ -45,5 +45,11 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>run</id>
|
||||||
|
<properties>
|
||||||
|
<skipTests>true</skipTests>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
<property name="description" value="A demonstration component" />
|
<property name="description" value="A demonstration component" />
|
||||||
<property name="sinceVersion" value="2.0" />
|
<property name="sinceVersion" value="2.0" />
|
||||||
<property name="appliesFromVersion" value="2.0" />
|
<property name="appliesFromVersion" value="2.0" />
|
||||||
|
<property name="nodeService" ref="NodeService" />
|
||||||
|
<property name="nodeLocatorService" ref="nodeLocatorService" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
@ -1,26 +1,83 @@
|
|||||||
|
/*
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
package org.alfresco.demoamp;
|
package org.alfresco.demoamp;
|
||||||
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import org.alfresco.repo.module.AbstractModuleComponent;
|
import org.alfresco.repo.module.AbstractModuleComponent;
|
||||||
|
import org.alfresco.repo.nodelocator.NodeLocatorService;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A basic component that will be started for this module.
|
* A basic component that will be started for this module.
|
||||||
* This is a sample taken from Maven Alfresco SDK
|
* Uses the NodeLocatorService to easily find nodes and the
|
||||||
|
* NodeService to display them
|
||||||
*
|
*
|
||||||
* @author Derek Hulley
|
* @author Gabriele Columbro
|
||||||
|
* @author Maurizio Pillitu
|
||||||
*/
|
*/
|
||||||
public class DemoComponent extends AbstractModuleComponent
|
public class DemoComponent extends AbstractModuleComponent
|
||||||
{
|
{
|
||||||
Log log = LogFactory.getLog(DemoComponent.class);
|
Log log = LogFactory.getLog(DemoComponent.class);
|
||||||
|
|
||||||
|
private NodeService nodeService;
|
||||||
|
|
||||||
|
private NodeLocatorService nodeLocatorService;
|
||||||
|
|
||||||
|
public void setNodeService(NodeService nodeService) {
|
||||||
|
this.nodeService = nodeService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNodeLocatorService(NodeLocatorService nodeLocatorService) {
|
||||||
|
this.nodeLocatorService = nodeLocatorService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bogus component execution
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void executeInternal() throws Throwable
|
protected void executeInternal() throws Throwable
|
||||||
{
|
{
|
||||||
System.out.println("DemoComponent has been executed");
|
System.out.println("DemoComponent has been executed");
|
||||||
log.debug("Test debug logging is working");
|
log.debug("Test debug logging. Congratulation your AMP is working");
|
||||||
log.info("This should not be outputted by default");
|
log.info("This is only for information purposed. Better remove me from the log in Production");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a demo service interaction with Alfresco Foundation API.
|
||||||
|
* This sample method returns the number of child nodes of a certain type
|
||||||
|
* under a certain node.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int childNodesCount(NodeRef nodeRef)
|
||||||
|
{
|
||||||
|
return nodeService.countChildAssocs(nodeRef, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the NodeRef of "Company Home"
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public NodeRef getCompanyHome()
|
||||||
|
|
||||||
|
{
|
||||||
|
return nodeLocatorService.getNode("companyhome", null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,6 +145,13 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.alfresco.maven</groupId>
|
||||||
|
<artifactId>alfresco-rad</artifactId>
|
||||||
|
<version>${maven.alfresco.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</profile>
|
</profile>
|
||||||
<!-- Installs the needed runtime artifact for an RM (Records Management) project -->
|
<!-- Installs the needed runtime artifact for an RM (Records Management) project -->
|
||||||
<profile>
|
<profile>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user