Skip to content

Commit

Permalink
Un-ignore half of test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthree committed Jan 9, 2014
1 parent 69be472 commit 963ed1a
Showing 1 changed file with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.forge.addon.database.tools.connections.ConnectionProfile;
import org.jboss.forge.addon.database.tools.connections.ConnectionProfileManager;
import org.jboss.forge.addon.database.tools.connections.CreateConnectionProfileCommand;
import org.jboss.forge.addon.database.tools.connections.HibernateDialect;
import org.jboss.forge.addon.dependencies.Dependency;
import org.jboss.forge.addon.dependencies.DependencyQuery;
import org.jboss.forge.addon.dependencies.DependencyResolver;
Expand All @@ -31,7 +27,6 @@
import org.jboss.forge.ui.test.UITestHarness;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -67,13 +62,13 @@ public static ForgeArchive getDeployment()

@Inject
private ConnectionProfileManager manager;

@Inject
private UITestHarness testHarness;

@Inject
private DependencyResolver resolver;

@Test
public void testConnectionProfileManager() throws Exception
{
Expand All @@ -85,12 +80,12 @@ public void testConnectionProfileManager() throws Exception
profiles = manager.loadConnectionProfiles();
Assert.assertEquals(0, profiles.size());
}

@Ignore

@Test
public void testCreateConnectionProfileCommand() throws Exception {
CommandController command = testHarness.createCommandController(CreateConnectionProfileCommand.class);
command.initialize();
public void testCreateConnectionProfileCommand() throws Exception
{
CommandController command = testHarness.createCommandController(CreateConnectionProfileCommand.class);
command.initialize();
command.setValueFor("name", "test");
command.setValueFor("jdbcUrl", "jdbc:h2:~/app-root/data/sakila");
command.setValueFor("userName", "sa");
Expand All @@ -100,18 +95,22 @@ public void testCreateConnectionProfileCommand() throws Exception {
command.setValueFor("driverClass", "org.h2.Driver");
command.execute();
Map<String, ConnectionProfile> profiles = manager.loadConnectionProfiles();
Assert.assertEquals(2, profiles.size());
Assert.assertEquals(1, profiles.size());
ConnectionProfile profile = profiles.get("test");
Assert.assertNotNull(profile);
Assert.assertEquals("org.h2.Driver", profile.getDriver());
}

private FileResource<?> resolveH2DriverJarResource() {

private FileResource<?> resolveH2DriverJarResource()
{
DependencyQuery query = DependencyQueryBuilder.create("com.h2database:h2:1.3.167");
Dependency dependency = resolver.resolveArtifact(query);
if (dependency != null) {
if (dependency != null)
{
return dependency.getArtifact();
} else {
}
else
{
return null;
}
}
Expand Down

0 comments on commit 963ed1a

Please sign in to comment.