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-17: make sure commands tests are run in useHttp mode.
* added the CommandOverHttpDUnitTest in geode-web * added GfshCommandsOverHttpSecurityTest in geode-web * move ConnectCommandWithHttpAndSSLDUnitTest to geode-web * make sure ConnectCommandWithHttpAndSSLDUnitTest is running with the correct connection method * updated the trusted.keystore with the supported algorithm * create a SuiteRunner so that we can run tests in a suite yet have them report to its own xml
- Loading branch information
1 parent
97d6172
commit c79b64f
Showing
13 changed files
with
244 additions
and
83 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
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
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
Binary file modified
BIN
+1.14 KB
(210%)
geode-core/src/test/resources/ssl/trusted.keystore
100755 → 100644
Binary file not shown.
46 changes: 46 additions & 0 deletions
46
geode-junit/src/main/java/com/gemstone/gemfire/test/junit/runner/SuiteBlockRunner.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,46 @@ | ||
/* | ||
* 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 com.gemstone.gemfire.test.junit.runner; | ||
|
||
import org.junit.runners.BlockJUnit4ClassRunner; | ||
import org.junit.runners.model.FrameworkMethod; | ||
import org.junit.runners.model.InitializationError; | ||
|
||
/** | ||
* used by SuiteRunner to override the test method name | ||
*/ | ||
public class SuiteBlockRunner extends BlockJUnit4ClassRunner { | ||
|
||
private Class<?> suiteClass; | ||
|
||
/** | ||
* Creates a BlockJUnit4ClassRunner to run {@code klass} | ||
* @param klass | ||
* @throws InitializationError if the test class is malformed. | ||
*/ | ||
public SuiteBlockRunner(final Class parentClass, final Class<?> klass) throws InitializationError { | ||
super(klass); | ||
this.suiteClass = parentClass; | ||
} | ||
|
||
@Override | ||
protected String testName(FrameworkMethod method) { | ||
return method.getName()+"@"+ suiteClass.getName(); | ||
} | ||
|
||
} |
53 changes: 53 additions & 0 deletions
53
geode-junit/src/main/java/com/gemstone/gemfire/test/junit/runner/SuiteRunner.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 com.gemstone.gemfire.test.junit.runner; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.junit.runner.Runner; | ||
import org.junit.runners.Suite; | ||
import org.junit.runners.model.InitializationError; | ||
import org.junit.runners.model.RunnerBuilder; | ||
|
||
/** | ||
* SuiteRunner is like Junit Suite, it's used in conjunction with <code>SuiteClass({xx.class, yy.class})</code> | ||
* It's different from Suite in two ways: | ||
* 1. it should only contain contain Junit4 test classes | ||
* 2. the test method names inside each test class are appended with the suiteClass name so that the result will show up different | ||
* as when you run these tests alone. | ||
*/ | ||
public class SuiteRunner extends Suite { | ||
|
||
public SuiteRunner(final Class<?> klass, final RunnerBuilder builder) throws InitializationError { | ||
super(klass, getRunners(klass)); | ||
} | ||
|
||
private static List<Runner> getRunners(final Class<?> klass) throws InitializationError{ | ||
SuiteClasses annotation = klass.getAnnotation(SuiteClasses.class); | ||
if (annotation == null) { | ||
throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", klass.getName())); | ||
} | ||
Class<?>[] childClasses = annotation.value(); | ||
List<Runner> runners = new ArrayList<>(); | ||
for(Class childClass:childClasses){ | ||
runners.add(new SuiteBlockRunner(klass, childClass)); | ||
} | ||
return runners; | ||
} | ||
} |
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
Oops, something went wrong.