Permalink
Browse files

Support of AG 4.6 - Rfe8881 - Optionally suppress duplicates at commi…

…t time

Signed-off-by: Aymeric Brisse <aymeric.brisse@perfect-memory.com>
  • Loading branch information...
1 parent 628a37e commit f473656708444384b20ed55e402e03c76a860fed @abrisse committed Jun 28, 2012
Showing with 40 additions and 0 deletions.
  1. +10 −0 lib/allegro_graph/repository.rb
  2. +14 −0 spec/fake_transport.yml
  3. +16 −0 spec/lib/allegro_graph/repository_spec.rb
@@ -70,6 +70,16 @@ def remove_duplicates(mode=:spog)
response.to_i
end
+ def suppress_duplicates=(type=:spog)
+ response = @server.request_http :put, self.path + "/suppressDuplicates", :parameters => {:type => type.to_s}, :expected_status_code => 204
+ true
+ end
+
+ def suppress_duplicates
+ strategy = @server.request_http :get, self.path + "/suppressDuplicates", :expected_status_code => 200
+ strategy == 'false' ? false : strategy.to_sym
+ end
+
def optimize(parameters={})
parameters = { :wait => 'false', :level => '1' }.merge(parameters)
response = @server.request_http :post, self.path + "/indices/optimize", :parameters => parameters, :expected_status_code => 204
@@ -122,6 +122,20 @@
:code: "204"
:body: "nil"
-
+ :http_method: "get"
+ :url: "http://localhost:10035/catalogs/test_catalog/repositories/test_repository/suppressDuplicates"
+ :response:
+ :code: "200"
+ :body: "spog"
+-
+ :http_method: "put"
+ :url: "http://localhost:10035/catalogs/test_catalog/repositories/test_repository/suppressDuplicates"
+ :parameters:
+ :type: "spog"
+ :response:
+ :code: "204"
+ :body: "nil"
+-
:http_method: "delete"
:url: "http://localhost:10035/catalogs/test_catalog/repositories/test_repository/statements/duplicates"
:parameters:
@@ -211,6 +211,22 @@
end
+ describe "suppress_duplicates=" do
+
+ it "should set the suppress duplicates" do
+ (@repository.suppress_duplicates=:spog).should == :spog
+ end
+
+ end
+
+ describe "suppress_duplicates" do
+
+ it "should set the suppress duplicates" do
+ @repository.suppress_duplicates.should == :spog
+ end
+
+ end
+
describe "optimize" do
it "should optimize the indices" do

0 comments on commit f473656

Please sign in to comment.