-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bindings/java): add cucumber test case for memory
- Loading branch information
Showing
7 changed files
with
254 additions
and
97 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
53 changes: 53 additions & 0 deletions
53
bindings/java/src/test/java/org/apache/opendal/AsyncStepsTest.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 org.apache.opendal; | ||
|
||
import io.cucumber.java.en.Given; | ||
import io.cucumber.java.en.Then; | ||
import io.cucumber.java.en.When; | ||
|
||
|
||
public class AsyncStepsTest { | ||
|
||
|
||
@Given("A new OpenDAL Async Operator") | ||
public void a_new_open_dal_async_operator() { | ||
} | ||
|
||
@When("Async write path {string} with content {string}") | ||
public void async_write_path_test_with_content_hello_world(String fileName, String content) { | ||
} | ||
|
||
@Then("The async file {string} should exist") | ||
public void the_async_file_test_should_exist(String fileName) { | ||
} | ||
|
||
@Then("The async file {string} entry mode must be file") | ||
public void the_async_file_test_entry_mode_must_be_file(String fileName) { | ||
} | ||
|
||
@Then("The async file {string} content length must be {int}") | ||
public void the_async_file_test_content_length_must_be_13(String fileName, int length) { | ||
} | ||
|
||
@Then("The async file {string} must have content {string}") | ||
public void the_async_file_test_must_have_content_hello_world(String fileName, String content) { | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
bindings/java/src/test/java/org/apache/opendal/CucumberTest.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,35 @@ | ||
/* | ||
* 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 org.apache.opendal; | ||
|
||
import org.junit.platform.suite.api.ConfigurationParameter; | ||
import org.junit.platform.suite.api.IncludeEngines; | ||
import org.junit.platform.suite.api.SelectClasspathResource; | ||
import org.junit.platform.suite.api.Suite; | ||
|
||
import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; | ||
|
||
@Suite | ||
@IncludeEngines("cucumber") | ||
@SelectClasspathResource("features") | ||
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "org.apache.opendal") | ||
public class CucumberTest { | ||
|
||
} |
74 changes: 74 additions & 0 deletions
74
bindings/java/src/test/java/org/apache/opendal/StepsTest.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,74 @@ | ||
/* | ||
* 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 org.apache.opendal; | ||
|
||
import io.cucumber.java.en.Given; | ||
import io.cucumber.java.en.Then; | ||
import io.cucumber.java.en.When; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class StepsTest { | ||
|
||
Operator operator; | ||
|
||
@Given("A new OpenDAL Blocking Operator") | ||
public void a_new_open_dal_blocking_operator() { | ||
Map<String, String> params = new HashMap<>(); | ||
params.put("root", "/tmp"); | ||
this.operator = new Operator("Memory", params); | ||
} | ||
|
||
@When("Blocking write path {string} with content {string}") | ||
public void blocking_write_path_test_with_content_hello_world(String fileName, String content) { | ||
this.operator.write(fileName, content); | ||
} | ||
|
||
|
||
@Then("The blocking file {string} should exist") | ||
public void the_blocking_file_test_should_exist(String content) { | ||
|
||
} | ||
|
||
|
||
@Then("The blocking file {string} entry mode must be file") | ||
public void the_blocking_file_test_entry_mode_must_be_file(String fileName) { | ||
|
||
} | ||
|
||
@Then("The blocking file {string} content length must be {int}") | ||
public void the_blocking_file_test_content_length_must_be_13(String fileName, int length) { | ||
String content = this.operator.read(fileName); | ||
|
||
assertEquals(content.length(), length); | ||
} | ||
|
||
@Then("The blocking file {string} must have content {string}") | ||
public void the_blocking_file_test_must_have_content_hello_world(String fileName, String content) { | ||
String readContent = this.operator.read(fileName); | ||
|
||
assertEquals(content, readContent); | ||
} | ||
|
||
|
||
} |
62 changes: 0 additions & 62 deletions
62
bindings/java/src/test/java/org/apache/opendal/operator/OperatorTest.java
This file was deleted.
Oops, something went wrong.