-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from dcrissman/add-info-methods
Make use of the new AbstractMongoCRUDTestController
- Loading branch information
Showing
16 changed files
with
163 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
...gration-test/src/test/java/com/redhat/lightblue/crud/ldap/AbstractLdapCRUDController.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...ue-ldap-test/src/main/java/com/redhat/lightblue/ldap/test/AbstractLdapCRUDController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
Copyright 2015 Red Hat, Inc. and/or its affiliates. | ||
This file is part of lightblue. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.redhat.lightblue.ldap.test; | ||
|
||
import static com.redhat.lightblue.util.JsonUtils.json; | ||
|
||
import java.io.IOException; | ||
|
||
import org.junit.BeforeClass; | ||
import org.junit.ClassRule; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.redhat.lightblue.ldap.test.LdapServerExternalResource.InMemoryLdapServer; | ||
import com.redhat.lightblue.mongo.test.AbstractMongoCRUDTestController; | ||
|
||
@InMemoryLdapServer | ||
public abstract class AbstractLdapCRUDController extends AbstractMongoCRUDTestController { | ||
|
||
@ClassRule | ||
public static LdapServerExternalResource ldapServer = LdapServerExternalResource.createDefaultInstance(); | ||
|
||
@BeforeClass | ||
public static void prepareLdapDatasources() { | ||
if (System.getProperty("ldap.datasource") == null) { | ||
System.setProperty("ldap.datasource", "myldapdatasource"); | ||
} | ||
if (System.getProperty("ldap.host") == null) { | ||
System.setProperty("ldap.host", "localhost"); | ||
} | ||
if (System.getProperty("ldap.port") == null) { | ||
System.setProperty("ldap.port", String.valueOf(ldapServer.getPort())); | ||
} | ||
if (System.getProperty("ldap.database") == null) { | ||
System.setProperty("ldap.database", "test"); | ||
} | ||
} | ||
|
||
public AbstractLdapCRUDController() throws Exception { | ||
super(); | ||
} | ||
|
||
@Override | ||
protected JsonNode getLightblueCrudJson() throws Exception { | ||
return json(loadResource("/ldap-lightblue-crud.json", true)); | ||
} | ||
|
||
@Override | ||
protected JsonNode getLightblueMetadataJson() throws Exception { | ||
return json(loadResource("/ldap-lightblue-metadata.json", true)); | ||
} | ||
|
||
@Override | ||
protected JsonNode getDatasourcesJson() { | ||
try { | ||
if (getDatasourcesResourceName() == null) { | ||
return json(loadResource("/ldap-datasources.json", true)); | ||
} else { | ||
return json(loadResource(getDatasourcesResourceName(), false)); | ||
} | ||
} catch (IOException e) { | ||
throw new RuntimeException("Unable to load resource '" + getDatasourcesResourceName() + "'", e); | ||
} | ||
} | ||
|
||
} |
40 changes: 0 additions & 40 deletions
40
...e-ldap-test/src/main/java/com/redhat/lightblue/ldap/test/DefaultEquivalencyEvaluator.java
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
lightblue-ldap-test/src/main/java/com/redhat/lightblue/ldap/test/EquivalencyEvaluator.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.