Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic integration test now running, but still hitting the wrong server.
- Loading branch information
Ole Friis Østergaard
committed
May 30, 2011
1 parent
018e76e
commit bd80428
Showing
8 changed files
with
124 additions
and
20 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
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,2 @@ | ||
drop database if exists sdm_warehouse_ig; | ||
create database sdm_warehouse_ig; |
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
Binary file not shown.
Binary file not shown.
61 changes: 61 additions & 0 deletions
61
subprojects/integration-test/src/test/java/DummyIntegrationTest.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,61 @@ | ||
import static org.junit.Assert.*; | ||
|
||
import java.net.URL; | ||
import java.net.URLConnection; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import javax.xml.stream.XMLEventReader; | ||
import javax.xml.stream.XMLInputFactory; | ||
import javax.xml.stream.events.XMLEvent; | ||
|
||
import org.junit.Test; | ||
|
||
import com.trifork.stamdata.client.security.TwoWaySslSecurityHandler; | ||
|
||
public class DummyIntegrationTest { | ||
@Test | ||
public void dummy() throws Exception { | ||
Set<String> texts = new HashSet<String>(); | ||
|
||
new DummyTwoWaySslSecurityHandler(); | ||
URLConnection connection = new URL("https://localhost:8443/lookup/person/0708610089").openConnection(); | ||
XMLInputFactory readerFactory = XMLInputFactory.newInstance(); | ||
XMLEventReader reader = readerFactory.createXMLEventReader(connection.getInputStream(), "UTF-8"); | ||
try { | ||
while (reader.hasNext()) { | ||
XMLEvent event = reader.nextEvent(); | ||
if (event.isCharacters()) { | ||
texts.add(event.asCharacters().getData()); | ||
} | ||
} | ||
} finally { | ||
reader.close(); | ||
} | ||
|
||
assertTrue("No CPR number in output: " + texts, texts.contains("0708610089")); | ||
} | ||
|
||
|
||
static class DummyTwoWaySslSecurityHandler extends TwoWaySslSecurityHandler { | ||
@Override | ||
protected String getTrustStorePassword() { | ||
return "Test1234"; | ||
} | ||
|
||
@Override | ||
protected String getTrustStorePath() { | ||
return "classpath:/truststore.jks"; | ||
} | ||
|
||
@Override | ||
protected String getKeyStorePassword() { | ||
return "Test1234"; | ||
} | ||
|
||
@Override | ||
protected String getKeyStorePath() { | ||
return "classpath:/keystore.jks"; | ||
} | ||
} | ||
} |
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