You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by di...@apache.org on 2011/05/04 19:55:27 UTC
[Lucene.Net] svn commit: r1099543 -
/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/TestSupportClass.cs
Author: digy
Date: Wed May 4 17:55:27 2011
New Revision: 1099543
URL: http://svn.apache.org/viewvc?rev=1099543&view=rev
Log:
[LUCENENET-412] TestSupportClass
Modified:
incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/TestSupportClass.cs
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/TestSupportClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/TestSupportClass.cs?rev=1099543&r1=1099542&r2=1099543&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/TestSupportClass.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/TestSupportClass.cs Wed May 4 17:55:27 2011
@@ -1210,6 +1210,94 @@ namespace Lucene.Net._SupportClass
[Serializable]
public class TestMediumTrust
{
+ [Test]
+ public void TestIndexAndSearch()
+ {
+ Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "TestIndexAndSearch", null, null);
+ }
+
+ [Test]
+ public void Test_Index_Term()
+ {
+
+ Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_Index_Term", null, null);
+ }
+
+ [Test]
+ public void Test_Search_NumericRangeQuery()
+ {
+ Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_Search_NumericRangeQuery", null, null);
+ }
+
+ [Test]
+ public void Test_Search_SortField()
+ {
+ //invoke any method
+ Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_Search_SortField", null, null);
+ }
+
+ [Test]
+ public void Test_AlreadyClosedException()
+ {
+ Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_AlreadyClosedException", null, null);
+ }
+
+ [Test]
+ public void Test_AlreadyClosedException_Serialization()
+ {
+ try
+ {
+ Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_AlreadyClosedException_Serialization", null, null);
+ }
+ catch (System.Security.SecurityException)
+ {
+ Assert.Ignore("This method failed with a security exception");
+ }
+ }
+
+ [Test]
+ public void Test_Util_Parameter()
+ {
+ //invoke any method
+ Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_Util_Parameter", null, null);
+ }
+
+ [Test]
+ public void TestThisTest()
+ {
+ try
+ {
+ Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(DummyClass), "DummyMethod", null, null);
+ Assert.Fail("This call must fail-1");
+ }
+ catch(TypeLoadException)
+ {
+ }
+
+ try
+ {
+ Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "MethodToFail", null, null);
+ Assert.Fail("This call must fail-2");
+ }
+ catch (System.Security.SecurityException)
+ {
+ }
+ }
+
+
+ public class DummyClass: System.Runtime.Serialization.IObjectReference
+ {
+ public void DummyMethod()
+ {
+ }
+
+ public object GetRealObject(System.Runtime.Serialization.StreamingContext context)
+ {
+ return this;
+ }
+ }
+
+
public class TestMethodContainer : MarshalByRefObject
{
void TestIndexAndSearch()
@@ -1251,7 +1339,7 @@ namespace Lucene.Net._SupportClass
void Test_Search_NumericRangeQuery()
{
- Lucene.Net.Search.Query q = NumericRangeQuery.NewIntRange("field", 0, 10, true, true);
+ Lucene.Net.Search.Query q = NumericRangeQuery.NewIntRange("field", 0, 10, true, true);
}
void Test_Search_SortField()
@@ -1278,18 +1366,18 @@ namespace Lucene.Net._SupportClass
bf.Serialize(ms, ace);
ms.Seek(0, System.IO.SeekOrigin.Begin);
AlreadyClosedException ace2 = (AlreadyClosedException)bf.Deserialize(ms);
- throw ace2;
}
-
+
void Test_Util_Parameter()
{
string s = new PARAM("field").ToString();
}
-
+
[Serializable]
public class PARAM : Lucene.Net.Util.Parameter
{
- public PARAM(string field) : base(field)
+ public PARAM(string field)
+ : base(field)
{
}
}
@@ -1299,99 +1387,7 @@ namespace Lucene.Net._SupportClass
{
return System.Environment.GetEnvironmentVariable("TEMP");
}
-
-
}
-
- [Test]
- public void TestIndexAndSearch()
- {
- Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "TestIndexAndSearch", null, null);
- }
-
-
-
- [Test]
- public void Test_Index_Term()
- {
-
- Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_Index_Term", null, null);
- }
-
-
-
- [Test]
- public void Test_Search_NumericRangeQuery()
- {
- Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_Search_NumericRangeQuery", null, null);
- }
-
-
-
- [Test]
- public void Test_Search_SortField()
- {
- //invoke any method
- Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_Search_SortField", null, null);
- }
-
- [Test]
- public void Test_AlreadyClosedException()
- {
- Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_AlreadyClosedException", null, null);
- }
-
- [Test]
- public void Test_AlreadyClosedException_Serialization()
- {
- Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_AlreadyClosedException_Serialization", null, null);
- }
-
-
-
-
- [Test]
- public void Test_Util_Parameter()
- {
- //invoke any method
- Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "Test_Util_Parameter", null, null);
- }
-
- [Test]
- public void TestThisTest()
- {
- try
- {
- Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestDummyClass), "DummyMethod", null, null);
- Assert.Fail("This call must fail-1");
- }
- catch(TypeLoadException)
- {
- }
-
- try
- {
- Lucene.Net.Test.PartiallyTrustedAppDomain.Run(typeof(TestMethodContainer), "MethodToFail", null, null);
- Assert.Fail("This call must fail-2");
- }
- catch (System.Security.SecurityException)
- {
- }
- }
-
- public class TestDummyClass: System.Runtime.Serialization.IObjectReference
- {
- public void DummyMethod()
- {
- }
-
- public object GetRealObject(System.Runtime.Serialization.StreamingContext context)
- {
- return this;
- }
- }
-
-
}
}