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>
|
||||
</includes>
|
||||
</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">
|
||||
<directory>src/main/amp</directory>
|
||||
<includes>
|
||||
|
@ -45,5 +45,11 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>run</id>
|
||||
<properties>
|
||||
<skipTests>true</skipTests>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
@ -29,6 +29,8 @@
|
||||
<property name="description" value="A demonstration component" />
|
||||
<property name="sinceVersion" value="2.0" />
|
||||
<property name="appliesFromVersion" value="2.0" />
|
||||
<property name="nodeService" ref="NodeService" />
|
||||
<property name="nodeLocatorService" ref="nodeLocatorService" />
|
||||
</bean>
|
||||
|
||||
</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;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
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.LogFactory;
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
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
|
||||
protected void executeInternal() throws Throwable
|
||||
{
|
||||
System.out.println("DemoComponent has been executed");
|
||||
log.debug("Test debug logging is working");
|
||||
log.info("This should not be outputted by default");
|
||||
log.debug("Test debug logging. Congratulation your AMP is working");
|
||||
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>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.maven</groupId>
|
||||
<artifactId>alfresco-rad</artifactId>
|
||||
<version>${maven.alfresco.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<!-- Installs the needed runtime artifact for an RM (Records Management) project -->
|
||||
<profile>
|
||||
|
Loading…
x
Reference in New Issue
Block a user