Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Carbon Deployment version to v5.2.0 #69

Merged
merged 3 commits into from
Dec 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ private static SortedSet<Page> createPages(AppReference appReference) {
List<Page> pages = appReference.getPageReferences().stream()
.map(AppCreator::createPage)
.collect(Collectors.toList());
if (pages.isEmpty()) {
throw new AppCreationException("App '" + appReference.getName() + "' does not contains any pages.");
}

// TODO: 10/13/17 remove following workaround after adding support for URI patterns with * in UriPatten class
if ((pages.size() == 1) && (pages.get(0).getUriPatten().matches("/index"))) {
final Page indexPage = pages.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public Object deploy(Artifact artifact) throws CarbonDeploymentException {
previouslyCreatedOverridableApp.get(), createdApp);
publishAppUndeploymentEvent(previouslyCreatedOverridableApp.get());
appRegistry.add(createdApp);
deployingApp = new OverriddenApp(createdApp, previouslyCreatedOverridableApp.get());
deployingApp = new OverriddenApp(previouslyCreatedOverridableApp.get(), createdApp);
} else {
deployingApp = createdApp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,16 @@ public String getName() throws FileOperationException {
public Set<PageReference> getPageReferences() throws FileOperationException {
Path pages = getPagesDirectory();
if (!Files.exists(pages)) {
throw new FileOperationException(
"Cannot find '" + DIR_NAME_PAGES + "' directory in app '" + appDirectory + "'.");
return Collections.emptySet();
}
Set<PageReference> pageReferences;
try {
pageReferences = Files.walk(pages)
return Files.walk(pages)
.filter(Files::isRegularFile)
.map(pageFile -> new ArtifactPageReference(pageFile, this))
.collect(Collectors.toSet());
} catch (IOException e) {
throw new FileOperationException("An error occurred while listing pages in '" + pages + "'.", e);
}
return pageReferences;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.wso2.carbon.uiserver.api.App;
import org.wso2.carbon.uiserver.internal.exception.AppCreationException;
import org.wso2.carbon.uiserver.internal.io.reference.ArtifactAppReference;
import org.wso2.carbon.uiserver.internal.reference.AppReference;

Expand All @@ -39,7 +38,8 @@ public class AppCreatorTest {
public Object[][] appReferences() {
return new Object[][]{
{new ArtifactAppReference(Paths.get("src/test/resources/apps/full-app/"))},
{new ArtifactAppReference(Paths.get("src/test/resources/apps/minimal-app/"))}
{new ArtifactAppReference(Paths.get("src/test/resources/apps/minimal-app/"))},
{new ArtifactAppReference(Paths.get("src/test/resources/apps/empty-app/"))}
};
}

Expand All @@ -48,11 +48,4 @@ public void testCreateApp(AppReference appReference) {
App app = AppCreator.createApp(appReference, "/test");
Assert.assertNotNull(app);
}

@Test
public void testCreateAppWithEmptyDirectory() {
AppReference appReference = new ArtifactAppReference(Paths.get("src/test/resources/apps/empty-app/"));
Assert.assertThrows(AppCreationException.class,
() -> AppCreator.createApp(appReference, "/test"));
}
}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@
<carbon.touchpoint.version>1.1.0</carbon.touchpoint.version>

<!--Deployment-->
<carbon.deployment.version>5.1.9</carbon.deployment.version>
<carbon.deployment.version.range>[5.1.9, 6.0.0)</carbon.deployment.version.range>
<carbon.deployment.version>5.2.0</carbon.deployment.version>
<carbon.deployment.version.range>[5.2.0, 6.0.0)</carbon.deployment.version.range>

<!--Config-->
<carbon.config.version>2.1.5</carbon.config.version>
Expand Down