Skip to content

Commit

Permalink
Merge pull request #69 from this/bump-carbon-deployment-5.2.0
Browse files Browse the repository at this point in the history
Bump Carbon Deployment version to v5.2.0
  • Loading branch information
TanyaM committed Dec 19, 2017
2 parents d9b14e5 + 7544811 commit b7b71da
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
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

0 comments on commit b7b71da

Please sign in to comment.