Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/Spring/Spring.Core.Tests/Spring.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(ProjectDir)Data&quot; &quot;$(OutDir)&quot; /y /s /q /d" />
<Exec Command="copy &quot;$(ProjectDir)App.config&quot; &quot;$(OutDir)testhost.dll.config&quot;" />
<Exec Command="copy &quot;$(ProjectDir)App.config&quot; &quot;$(OutDir)ReSharperTestRunner64.dll.config&quot;" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ protected override string[] ConfigLocations
}
}

#endregion
protected override void OnSetUp()
{
TestObjectDao.Cleanup();
base.OnSetUp();
}

#endregion
}
}
3 changes: 3 additions & 0 deletions test/Spring/Spring.Data.Integration.Tests/Data/DTCTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public void SetUp()
}

[Test]
#if NETCOREAPP
[Ignore("Not supported on .NET Core")]
#endif
public void DeclarativeWithAttributes()
{
IAccountManager mgr = ctx["accountManager"] as IAccountManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public void SetUp()
}

[Test]
#if NETCOREAPP
[Ignore("Not supported on .NET Core")]
#endif
public void DeclarativeWithAttributes()
{
SimpleAccountManager mgr = ctx["accountManager"] as SimpleAccountManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ public interface ITestObjectDao
//
int GetCountByAltMethod(int lowerAgeLimit);
int GetCountByCommandSetter(int lowerAgeLimit);
void Cleanup();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,10 @@ public int GetCountByCommandSetter(int lowerAgeLimit)
{
throw new NotImplementedException();
}

public void Cleanup()
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,10 @@ public object MapRow(IDataReader dataReader, int rowNum)
#endregion

}
}

public void Cleanup()
{
AdoTemplate.ExecuteNonQuery(CommandType.Text, "delete from TestObjects ");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
xmlns:tx="http://www.springframework.net/tx"
xmlns:aop="http://www.springframework.net/aop">

<object type="Spring.Objects.Factory.Config.VariablePlaceholderConfigurer, Spring.Core">
<property name="VariableSources">
<list>
<object type="Spring.ProviderNameSource, Spring.Data.Integration.Tests" />
</list>
</property>
</object>

<db:provider id="DbProvider"
provider="SqlServer-2.0"
provider="${providerName}"
connectionString="Data Source=SPRINGQA;Initial Catalog=Spring;Persist Security Info=True;User ID=springqa;Password=springqa"/>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
xmlns:db="http://www.springframework.net/database">


<object type="Spring.Objects.Factory.Config.VariablePlaceholderConfigurer, Spring.Core">
<property name="VariableSources">
<list>
<object type="Spring.ProviderNameSource, Spring.Data.Integration.Tests" />
</list>
</property>
</object>

<db:provider id="DbProvider"
provider="SqlServer-2.0"
provider="${providerName}"
connectionString="Data Source=SPRINGQA;Database=Spring;Trusted_Connection=False;User ID=springqa;Password=springqa"/>

<object id="adoTemplate" type="Spring.Data.Core.AdoTemplate, Spring.Data">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
<objects xmlns='http://www.springframework.net'
xmlns:db="http://www.springframework.net/database">

<object type="Spring.Objects.Factory.Config.VariablePlaceholderConfigurer, Spring.Core">
<property name="VariableSources">
<list>
<object type="Spring.ProviderNameSource, Spring.Data.Integration.Tests" />
</list>
</property>
</object>

<db:provider id="DbProvider"
provider="SqlServer-2.0"
provider="${providerName}"
connectionString="Data Source=SPRINGQA;Database=Spring;User ID=springqa;Password=springqa;Trusted_Connection=False"/>

<object id="adoTemplate" type="Spring.Data.Core.AdoTemplate, Spring.Data">
Expand Down
49 changes: 49 additions & 0 deletions test/Spring/Spring.Data.Integration.Tests/ProviderNameSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#region License

// /*
// * Copyright 2018 the original author or authors.
// *
// * Licensed 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.
// */

#endregion

#region using

using Spring.Objects.Factory.Config;

#endregion

namespace Spring
{
public class ProviderNameSource : IVariableSource
{
public bool CanResolveVariable(string name)
{
return name.ToLower() == "providername";
}

public string ResolveVariable(string name)
{
if (name.ToLower() != "providername")
{
return null;
}
#if NETCOREAPP
return "SqlServer";
#else
return "SqlServer-2.0";
#endif
}
}
}