Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

NCBC-174: Fix invalid unit tests for 1.2.1 release

Change-Id: Ifdc499a66d821f4336be72342fa3395d276a188b
Reviewed-on: http://review.couchbase.org/24413
Reviewed-by: Saakshi Manocha <saakshi.manocha@globallogic.com>
Tested-by: Saakshi Manocha <saakshi.manocha@globallogic.com>
  • Loading branch information...
commit d073c6e234dc4dd65dca08290df4693d79b04dde 1 parent cc99855
@johnzablocki johnzablocki authored saakshimanocha committed
View
2  src/Couchbase.Tests/App.config
@@ -23,7 +23,7 @@
<add key="CouchbaseServerUrl" value="http://localhost:8091"/>
<add key="DefaultBucketName" value="default"/>
<add key="SaslBucketName" value="authenticated"/>
- <add key="SaslBucketPassword" value="password"/>
+ <add key="SaslBucketPassword" value="secret"/>
<add key="UserNameForLoginToCouchbaseServer" value="Administrator"/>
<add key="UserPasswordForLoginToCouchbaseServer" value="password"/>
</appSettings>
View
23 src/Couchbase.Tests/CouchbaseAuthenticatedViewTests.cs
@@ -24,7 +24,7 @@ public void When_Bucket_Is_Authenticated_View_Returns_Results()
{
var client = getClient(ConfigurationManager.AppSettings["SaslBucketName"], ConfigurationManager.AppSettings["SaslBucketPassword"]);
var view = client.GetView("cities", "by_name");
- Assert.That(view.Count(), Is.EqualTo(1), "Row count was not 1");
+ Assert.That(view.Count(), Is.GreaterThanOrEqualTo(1), "Row count was not 1");
}
/// <summary>
@@ -49,17 +49,16 @@ public void When_Bucket_Is_Authenticated_And_No_Credentials_Are_Provided_Excepti
/// <param name="bucketName">Name of bucket to be used</param>
/// <param name="bucketPassword">Password used to connect to bucket</param>
/// <returns>Couchbase client object</returns>
- private CouchbaseClient getClient(string bucketName, string bucketPassword)
- {
- var config = new CouchbaseClientConfiguration();
- config.Urls.Add(new Uri(ConfigurationManager.AppSettings["CouchbaseServerUrl"] + "/pools"));
- config.Bucket = bucketName;
- config.BucketPassword = bucketPassword;
- config.DesignDocumentNameTransformer = new DevelopmentModeNameTransformer();
- config.HttpClientFactory = new HammockHttpClientFactory();
- return new CouchbaseClient(config);
- }
- }
+ private CouchbaseClient getClient(string bucketName, string bucketPassword)
+ {
+ var config = new CouchbaseClientConfiguration();
+ config.Urls.Add(new Uri(ConfigurationManager.AppSettings["CouchbaseServerUrl"] + "/pools"));
+ config.Bucket = bucketName;
+ config.BucketPassword = bucketPassword;
+
+ return new CouchbaseClient(config);
+ }
+ }
}
#region [ License information ]
View
2  src/Couchbase.Tests/CouchbaseClientObserveTests.cs
@@ -150,7 +150,7 @@ public void When_Storing_A_New_Key_With_Master_Persistence_That_Key_Is_In_View_W
var storeResult = _Client.ExecuteStore(StoreMode.Set, key, value, PersistTo.One);
Assert.That(storeResult.Success, Is.True);
- var view = _Client.GetView("cities", "by_id").Key(key);
+ var view = _Client.GetView("cities", "by_id").Key(key).Stale(StaleMode.False);
int i = 0;
View
15 src/Couchbase.Tests/CouchbaseClusterBucketAdminTests.cs
@@ -121,16 +121,6 @@ public void When_Getting_Invalid_Bucket_Web_Exception_Is_Thrown()
{
var bucketName = "Bucket-" + DateTime.Now.Ticks;
- _Cluster.CreateBucket(new Bucket
- {
- Name = bucketName,
- AuthType = AuthTypes.Sasl,
- BucketType = BucketTypes.Membase,
- Quota = new Quota { RAM = 100 },
- ReplicaNumber = ReplicaNumbers.Zero
- }
- );
-
var bucket = waitForBucket(bucketName);
Assert.That(bucket, Is.Not.Null);
@@ -499,7 +489,10 @@ public void When_Deleting_Bucket_Bucket_Is_No_Longer_Listed()
/// @post: Test passes if deleting bucket throws an error
/// </summary>
[Test]
- [ExpectedException(typeof(WebException), ExpectedMessage = "404", MatchType = MessageMatch.Contains)]
+ [Ignore]
+ //TODO: When a bucket doesn't exist, the request throws a 500, but a 500 also might be thrown if the
+ //delete takes longer than the server expects it to. Though in this case, the delete is sucessful
+ //[ExpectedException(typeof(WebException), ExpectedMessage = "404", MatchType = MessageMatch.Contains)]
public void When_Deleting_Bucket_That_Does_Not_Exist_404_Web_Exception_Is_Thrown()
{
var bucketName = "Bucket-" + DateTime.Now.Ticks;
Please sign in to comment.
Something went wrong with that request. Please try again.