tests/requests/java_tests.rb in fog-oraclecloud-0.1.11 vs tests/requests/java_tests.rb in fog-oraclecloud-0.1.12

- old
+ new

@@ -54,16 +54,57 @@ servers.size >= 1 servers.first.status.is_a? String end end + tests('test jcs scaling ') do + scale_out_server_name = 'TestWLS_server_1' + test_service_name = 'TestWLS' + + test "scale out a cluster" do + instance = Fog::OracleCloud[:java].instances.get(test_service_name) + instance.scale_out_a_cluster('testcluster',false) + Fog::OracleCloud[:java].instances.get(test_service_name).wait_for(1800) { ready? } + Fog::OracleCloud[:java].instances.get(test_service_name).ready? + end + + test('get server') do + instance = Fog::OracleCloud[:java].instances.get(test_service_name) + instance.ready? + server = instance.servers.get(test_service_name,scale_out_server_name) + server.ready? + end + + test "scale a node" do + instance = Fog::OracleCloud[:java].instances.get(test_service_name) + instance.ready? + server = instance.servers.get(test_service_name,scale_out_server_name) + server.scale('oc4') + Fog::OracleCloud[:java].instances.get(test_service_name).wait_for(1800) { ready? } + server = instance.servers.get(test_service_name,scale_out_server_name) + server.ready? + server.shape == 'oc4' + end + + test "scale in a cluster" do + instance = Fog::OracleCloud[:java].instances.get(test_service_name) + instance.ready? + instance.servers.get(test_service_name,scale_out_server_name).scale_in_a_cluster + Fog::OracleCloud[:java].instances.get(test_service_name).wait_for(1800) { ready? } + Fog::OracleCloud[:java].instances.get(test_service_name).ready? + end + + end + tests("#java-delete", "create") do instance = Fog::OracleCloud[:java].instances.get('TestWLS') instance.dba_name = 'Admin', instance.dba_password = 'password' instance.destroy() instance.wait_for { stopping? } tests("should actually delete instance").raises(Fog::OracleCloud::Java::NotFound) do instance.wait_for { stopped? } end end + + end \ No newline at end of file