forked from apache/geode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-8358: Run Geode Redis session tests against native Redis (apach…
- Loading branch information
Showing
6 changed files
with
182 additions
and
17 deletions.
There are no files selected for viewing
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
65 changes: 65 additions & 0 deletions
65
geode-redis/src/acceptanceTest/java/session/NativeRedisSessionAcceptanceTest.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,65 @@ | ||
/* | ||
* 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 session; | ||
|
||
import org.junit.BeforeClass; | ||
import org.junit.ClassRule; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import org.junit.rules.TestRule; | ||
import org.testcontainers.containers.GenericContainer; | ||
import redis.clients.jedis.Jedis; | ||
|
||
import org.apache.geode.internal.AvailablePortHelper; | ||
import org.apache.geode.redis.session.RedisSessionDUnitTest; | ||
import org.apache.geode.test.junit.rules.IgnoreOnWindowsRule; | ||
|
||
public class NativeRedisSessionAcceptanceTest extends RedisSessionDUnitTest { | ||
|
||
@ClassRule | ||
public static TestRule ignoreOnWindowsRule = new IgnoreOnWindowsRule(); | ||
|
||
@BeforeClass | ||
public static void setup() { | ||
GenericContainer redisContainer = new GenericContainer<>("redis:5.0.6").withExposedPorts(6379); | ||
redisContainer.start(); | ||
int[] availablePorts = AvailablePortHelper.getRandomAvailableTCPPorts(2); | ||
ports.put(APP1, availablePorts[0]); | ||
ports.put(APP2, availablePorts[1]); | ||
ports.put(SERVER1, redisContainer.getFirstMappedPort()); | ||
|
||
jedisConnetedToServer1 = new Jedis("localhost", ports.get(SERVER1), JEDIS_TIMEOUT); | ||
startSpringApp(APP1, SERVER1, DEFAULT_SESSION_TIMEOUT); | ||
startSpringApp(APP2, SERVER1, DEFAULT_SESSION_TIMEOUT); | ||
} | ||
|
||
@Test | ||
@Ignore | ||
public void should_getSessionFromServer1_whenServer2GoesDown() { | ||
// Only using one server for Native Redis | ||
} | ||
|
||
@Test | ||
@Ignore | ||
public void should_getSessionFromServer_whenServerGoesDownAndIsRestarted() { | ||
// Only using one server for Native Redis | ||
} | ||
|
||
@Test | ||
@Ignore | ||
public void should_getSession_whenServer2GoesDown_andAppFailsOverToServer1() { | ||
// Only using one server for Native Redis | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
geode-redis/src/acceptanceTest/java/session/NativeRedisSessionExpirationAcceptanceTest.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,53 @@ | ||
/* | ||
* 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 session; | ||
|
||
import org.junit.BeforeClass; | ||
import org.junit.ClassRule; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import org.junit.rules.TestRule; | ||
import org.testcontainers.containers.GenericContainer; | ||
import redis.clients.jedis.Jedis; | ||
|
||
import org.apache.geode.internal.AvailablePortHelper; | ||
import org.apache.geode.redis.session.SessionExpirationDUnitTest; | ||
import org.apache.geode.test.junit.rules.IgnoreOnWindowsRule; | ||
|
||
public class NativeRedisSessionExpirationAcceptanceTest extends SessionExpirationDUnitTest { | ||
|
||
@ClassRule | ||
public static TestRule ignoreOnWindowsRule = new IgnoreOnWindowsRule(); | ||
|
||
@BeforeClass | ||
public static void setup() { | ||
GenericContainer redisContainer = new GenericContainer<>("redis:5.0.6").withExposedPorts(6379); | ||
redisContainer.start(); | ||
int[] availablePorts = AvailablePortHelper.getRandomAvailableTCPPorts(2); | ||
ports.put(APP1, availablePorts[0]); | ||
ports.put(APP2, availablePorts[1]); | ||
ports.put(SERVER1, redisContainer.getFirstMappedPort()); | ||
|
||
jedisConnetedToServer1 = new Jedis("localhost", ports.get(SERVER1), JEDIS_TIMEOUT); | ||
startSpringApp(APP1, SERVER1, SHORT_SESSION_TIMEOUT); | ||
startSpringApp(APP2, SERVER1, SHORT_SESSION_TIMEOUT); | ||
} | ||
|
||
@Test | ||
@Ignore | ||
public void sessionShouldTimeout_whenAppFailsOverToAnotherRedisServer() { | ||
// Only using one server for Native Redis | ||
} | ||
} |
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
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
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