This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into propaganda-0
- Loading branch information
Showing
367 changed files
with
11,881 additions
and
4,031 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
34 changes: 34 additions & 0 deletions
34
...t/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/login/AwaitLoginResponse.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,34 @@ | ||
/* | ||
* Copyright 2018 ConsenSys AG. | ||
* | ||
* Licensed 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 tech.pegasys.pantheon.tests.acceptance.dsl.condition.login; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import tech.pegasys.pantheon.tests.acceptance.dsl.WaitUtils; | ||
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition; | ||
import tech.pegasys.pantheon.tests.acceptance.dsl.httptransaction.LoginResponds; | ||
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node; | ||
|
||
public class AwaitLoginResponse implements Condition { | ||
|
||
private final LoginResponds transaction; | ||
|
||
public AwaitLoginResponse(final LoginResponds transaction) { | ||
this.transaction = transaction; | ||
} | ||
|
||
@Override | ||
public void verify(final Node node) { | ||
WaitUtils.waitFor(() -> assertThat(node.executeHttpTransaction(transaction)).isNotNull()); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...asys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetVersionPermissionException.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,44 @@ | ||
/* | ||
* Copyright 2018 ConsenSys AG. | ||
* | ||
* Licensed 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 tech.pegasys.pantheon.tests.acceptance.dsl.condition.net; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.catchThrowable; | ||
|
||
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition; | ||
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node; | ||
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.net.NetVersionTransaction; | ||
|
||
import org.web3j.protocol.exceptions.ClientConnectionException; | ||
|
||
public class ExpectNetVersionPermissionException implements Condition { | ||
|
||
private final NetVersionTransaction transaction; | ||
private final String expectedMessage; | ||
|
||
public ExpectNetVersionPermissionException( | ||
final NetVersionTransaction transaction, final String expectedMessage) { | ||
this.transaction = transaction; | ||
this.expectedMessage = expectedMessage; | ||
} | ||
|
||
@Override | ||
public void verify(final Node node) { | ||
final Throwable thrown = catchThrowable(() -> node.execute(transaction)); | ||
assertThat(thrown).isInstanceOf(RuntimeException.class); | ||
|
||
final Throwable cause = thrown.getCause(); | ||
assertThat(cause).isInstanceOf(ClientConnectionException.class); | ||
assertThat(cause.getMessage()).contains(expectedMessage); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...ch/pegasys/pantheon/tests/acceptance/dsl/condition/perm/WhiteListContainsKeyAndValue.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,50 @@ | ||
/* | ||
* Copyright 2019 ConsenSys AG. | ||
* | ||
* Licensed 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 tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import tech.pegasys.pantheon.ethereum.permissioning.WhitelistPersistor; | ||
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition; | ||
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node; | ||
|
||
import java.nio.file.Path; | ||
import java.util.Collection; | ||
|
||
public class WhiteListContainsKeyAndValue implements Condition { | ||
private final WhitelistPersistor.WHITELIST_TYPE whitelistType; | ||
private final Collection<String> whitelistValues; | ||
private final Path configFilePath; | ||
|
||
public WhiteListContainsKeyAndValue( | ||
final WhitelistPersistor.WHITELIST_TYPE whitelistType, | ||
final Collection<String> whitelistValues, | ||
final Path configFilePath) { | ||
this.whitelistType = whitelistType; | ||
this.whitelistValues = whitelistValues; | ||
this.configFilePath = configFilePath; | ||
} | ||
|
||
@Override | ||
public void verify(final Node node) { | ||
boolean result; | ||
try { | ||
result = | ||
WhitelistPersistor.verifyConfigFileMatchesState( | ||
whitelistType, whitelistValues, configFilePath); | ||
} catch (final Exception e) { | ||
result = false; | ||
} | ||
assertThat(result).isTrue(); | ||
} | ||
} |
Oops, something went wrong.