Skip to content

Commit

Permalink
Updating assembly validation txt (apache#4)
Browse files Browse the repository at this point in the history
* Updating assembly validation txt
Trying to remove disk store folders after test

* Attempt to clear out disk dirs between runs

* Added temporary folder and forced disk dirs to use the absolute path
  • Loading branch information
jhuynh1 authored and jmelchio committed Jun 25, 2020
1 parent a664647 commit 5ea4e0d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -837,14 +837,10 @@ javadoc/org/apache/geode/modules/session/bootstrap/package-frame.html
javadoc/org/apache/geode/modules/session/bootstrap/package-summary.html
javadoc/org/apache/geode/modules/session/bootstrap/package-tree.html
javadoc/org/apache/geode/modules/session/catalina/AbstractCacheLifecycleListener.html
javadoc/org/apache/geode/modules/session/catalina/AbstractCommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/AbstractSessionCache.html
javadoc/org/apache/geode/modules/session/catalina/ClientServerCacheLifecycleListener.html
javadoc/org/apache/geode/modules/session/catalina/ClientServerSessionCache.html
javadoc/org/apache/geode/modules/session/catalina/AbstractCommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat6CommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat7CommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat8CommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat9CommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/DeltaSession.html
javadoc/org/apache/geode/modules/session/catalina/DeltaSession7.html
javadoc/org/apache/geode/modules/session/catalina/DeltaSession8.html
Expand All @@ -857,9 +853,13 @@ javadoc/org/apache/geode/modules/session/catalina/PeerToPeerCacheLifecycleListen
javadoc/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.html
javadoc/org/apache/geode/modules/session/catalina/SessionCache.html
javadoc/org/apache/geode/modules/session/catalina/SessionManager.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat6CommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat6DeltaSessionManager.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat7CommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat7DeltaSessionManager.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat8CommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat8DeltaSessionManager.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat9CommitSessionValve.html
javadoc/org/apache/geode/modules/session/catalina/Tomcat9DeltaSessionManager.html
javadoc/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheLoader.html
javadoc/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheWriter.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,13 @@ public <T extends AbstractConfiguration<?>> ClusterManagementRealizationResult c
groups.add(groupName);
targetedMembers = memberValidator.findServers(groupName);
}

ClusterManagementRealizationResult result = new ClusterManagementRealizationResult();

// execute function on all targeted members
List<RealizationResult> functionResults = executeAndGetFunctionResult(
new CacheRealizationFunction(),
config, CacheElementOperation.CREATE,
targetedMembers);

functionResults.forEach(result::addMemberStatus);

// if any false result is added to the member list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.geode.test.junit.rules.TemporaryFileRule;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;
Expand Down Expand Up @@ -65,6 +69,9 @@ public class CreateDiskStoreDUnitTest {
@Autowired
private WebApplicationContext webApplicationContext;

@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();

@Rule
public ClusterStartupRule cluster = new ClusterStartupRule(1);

Expand All @@ -74,10 +81,8 @@ public class CreateDiskStoreDUnitTest {
private final String diskStoreName = "testDiskStore";
private MemberVM server;



@Before
public void before() {
public void before() throws Exception {
cluster.setSkipLocalDistributedSystemCleanup(true);
webContext = new LocatorWebContext(webApplicationContext);
client = new ClusterManagementServiceBuilder().setTransport(
Expand All @@ -96,14 +101,14 @@ public void after() {
return config;
});
if (server != null) {
server.stop();
server.stop(true);
}
}

private DiskStore createDiskStoreConfigObject(String diskStoreName) {
private DiskStore createDiskStoreConfigObject(String diskStoreName) throws IOException {
DiskStore diskStore = new DiskStore();
diskStore.setName(diskStoreName);
DiskDir diskDir = new DiskDir("DiskStoreDirectory", null);
DiskDir diskDir = new DiskDir(temporaryFolder.getRoot().getAbsolutePath() + File.pathSeparator + diskStoreName, null);
List<DiskDir> directories = new ArrayList<>();
directories.add(diskDir);
diskStore.setDirectories(directories);
Expand Down Expand Up @@ -160,7 +165,7 @@ public void createDiskStoreWithARunningServerShouldSucceed() {
assertThatThrownBy(() -> client.get(diskStore)).isInstanceOf(ClusterManagementException.class)
.hasMessageContaining("ENTITY_NOT_FOUND");

cluster.startServerVM(1, webContext.getLocator().getPort());
server = cluster.startServerVM(1, webContext.getLocator().getPort());

ClusterManagementRealizationResult result = client.create(diskStore);
assertThat(result.isSuccessful()).isTrue();
Expand All @@ -177,7 +182,7 @@ public void creatingADuplicateDiskStoreWhileServerRunningShouldThrowException()
assertThatThrownBy(() -> client.get(diskStore)).isInstanceOf(ClusterManagementException.class)
.hasMessageContaining("ENTITY_NOT_FOUND");

cluster.startServerVM(1, webContext.getLocator().getPort());
server = cluster.startServerVM(1, webContext.getLocator().getPort());

client.create(diskStore);

Expand All @@ -193,7 +198,7 @@ public void shouldBeAbleToGetACreatedDiskStore() {
assertThatThrownBy(() -> client.get(diskStore)).isInstanceOf(ClusterManagementException.class)
.hasMessageContaining("ENTITY_NOT_FOUND");

cluster.startServerVM(1, webContext.getLocator().getPort());
server = cluster.startServerVM(1, webContext.getLocator().getPort());

client.create(diskStore);

Expand Down Expand Up @@ -251,7 +256,7 @@ public void destroyingDiskStoreBeforeDiskStoresActuallyCreatedShouldSucceed() {
}

@Test
public void listDiskStoresShouldReturnAllConfiguredDiskStores() {
public void listDiskStoresShouldReturnAllConfiguredDiskStores() throws Exception {
assertThatThrownBy(() -> client.get(diskStore)).isInstanceOf(ClusterManagementException.class)
.hasMessageContaining("ENTITY_NOT_FOUND");

Expand All @@ -263,7 +268,7 @@ public void listDiskStoresShouldReturnAllConfiguredDiskStores() {


@Test
public void listDiskStoresShouldReturnNonDeletedDiskStores() {
public void listDiskStoresShouldReturnNonDeletedDiskStores() throws Exception {
assertThatThrownBy(() -> client.get(diskStore)).isInstanceOf(ClusterManagementException.class)
.hasMessageContaining("ENTITY_NOT_FOUND");

Expand Down

0 comments on commit 5ea4e0d

Please sign in to comment.