-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from thijslemmens/master
DEVEM-330 Fix configuration of amp task with plugin
- Loading branch information
Showing
9 changed files
with
95 additions
and
17 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/integration-test/resources/examples/simple-alfresco-project/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
plugins { | ||
id 'eu.xenit.alfresco' | ||
id 'eu.xenit.amp' | ||
} | ||
|
||
description = "HelloWorld Webscript, very useful" | ||
version = "0.0.1" | ||
|
||
ext.alfrescoVersion = "5.2.g" | ||
|
||
repositories { | ||
mavenCentral() | ||
jcenter() | ||
maven { | ||
url "https://artifacts.alfresco.com/nexus/content/groups/public/" | ||
} | ||
} | ||
|
||
dependencies { | ||
alfrescoProvided "org.alfresco:alfresco-repository:${alfrescoVersion}" | ||
} |
8 changes: 8 additions & 0 deletions
8
...co/extension/templates/webscripts/eu/xenit/alfresco/gradle/sample/helloworld.get.desc.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<webscript> | ||
<shortname>Hello World</shortname> | ||
<description>Hello World Sample Web Script that responds back with a greeting</description> | ||
<url>/eu/xenit/helloworld</url> | ||
<format default="html"></format> | ||
<authentication>user</authentication> | ||
<family>Xenit Samples</family> | ||
</webscript> |
8 changes: 8 additions & 0 deletions
8
...fresco-project/src/main/amp/config/alfresco/module/example-default-amp/module-context.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> | ||
<beans> | ||
<bean id="webscript.eu.xenit.alfresco.gradle.sample.helloworld.get" | ||
class="eu.xenit.alfresco.gradle.sample.HelloWorldWebScript" | ||
parent="webscript"> | ||
</bean> | ||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.id=$project.name | ||
module.description=$project.description | ||
module.version=$project.version | ||
module.title=$project.name |
15 changes: 15 additions & 0 deletions
15
...e-alfresco-project/src/main/java/eu/xenit/alfresco/gradle/sample/HelloWorldWebScript.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package eu.xenit.alfresco.gradle.sample; | ||
|
||
import java.io.IOException; | ||
import org.springframework.extensions.webscripts.AbstractWebScript; | ||
import org.springframework.extensions.webscripts.WebScriptRequest; | ||
import org.springframework.extensions.webscripts.WebScriptResponse; | ||
|
||
|
||
public class HelloWorldWebScript extends AbstractWebScript { | ||
|
||
@Override | ||
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException { | ||
res.getWriter().write("<h1>Hello World</h1>"); | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
...ple-alfresco-project/src/main/java/eu/xenit/gradle/alfrescosdk/integrationtest/Hello.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/test/java/eu/xenit/gradle/alfrescosdk/AmpPluginTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package eu.xenit.gradle.alfrescosdk; | ||
|
||
import eu.xenit.gradle.alfrescosdk.config.AmpConfig; | ||
import eu.xenit.gradle.alfrescosdk.tasks.Amp; | ||
import java.io.File; | ||
import org.gradle.api.internal.project.DefaultProject; | ||
import org.gradle.testfixtures.ProjectBuilder; | ||
import org.junit.Test; | ||
import static org.junit.Assert.*; | ||
|
||
public class AmpPluginTest { | ||
|
||
private DefaultProject getDefaultProject() { | ||
DefaultProject project = (DefaultProject) ProjectBuilder.builder().build(); | ||
project.getPluginManager().apply(AmpPlugin.class); | ||
return project; | ||
} | ||
|
||
@Test | ||
public void testConfigFolderEmpty(){ | ||
DefaultProject defaultProject = getDefaultProject(); | ||
Amp ampTask = (Amp) defaultProject.getTasks().getByName("amp"); | ||
assertNull(ampTask.getConfig()); | ||
} | ||
|
||
@Test | ||
public void testConfigDirectoryExists(){ | ||
DefaultProject defaultProject = getDefaultProject(); | ||
|
||
File configDir = new File(defaultProject.getProjectDir().getAbsolutePath()+"/"+AmpConfig.DEFAULT_CONFIG_DIR); | ||
assertTrue(configDir.mkdirs()); | ||
|
||
Amp ampTask = (Amp) defaultProject.getTasks().getByName("amp"); | ||
assertTrue(ampTask.getConfig().isDirectory()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters