Project

General

Profile

Revision 5110

Added by daigle almost 11 years ago

handle ben's change to the metacat client read api because it returns inputstream now

View differences:

test/edu/ucsb/nceas/metacattest/OnlineDataAccessTest.java
25 25

  
26 26
package edu.ucsb.nceas.metacattest;
27 27

  
28
import java.io.InputStreamReader;
28 29
import java.io.Reader;
29 30
import java.io.StringReader;
30 31
import java.util.Calendar;
......
2013 2014
    private void readDocid(String docid, boolean result,
2014 2015
                           boolean expextedKarmaFailure) {
2015 2016
        try {
2016
            Reader r = m.read(docid);
2017
            Reader r = new InputStreamReader(m.read(docid));
2017 2018
            String response = IOUtil.getAsString(r, true);
2018 2019

  
2019 2020
            if (!result) {
......
2051 2052
                                         boolean result,
2052 2053
                                         boolean expextedKarmaFailure) {
2053 2054
        try {
2054
            Reader r = m.read(docid);
2055
            Reader r = new InputStreamReader(m.read(docid));
2055 2056
            String doc = IOUtil.getAsString(r, true);
2056 2057
            if (result) {
2057 2058

  
test/edu/ucsb/nceas/metacattest/UploadIPCCDataTest.java
225 225
			  throw new Exception("login failed "+response);
226 226
		  }
227 227
		  // 1. Reads eml document from metacat
228
		  Reader r = metacat.read(docid);
228
		  Reader r = new InputStreamReader(metacat.read(docid));
229 229
          Document DOMdoc = XMLUtilities.getXMLReaderAsDOMDocument(r);
230 230
          Node rootNode = (Node)DOMdoc.getDocumentElement();
231 231
          
test/edu/ucsb/nceas/metacattest/NonAsciiCharacterTest.java
25 25

  
26 26
package edu.ucsb.nceas.metacattest;
27 27

  
28
import java.io.InputStreamReader;
28 29
import java.io.Reader;
29 30
import java.io.StringReader;
30 31
import java.util.Calendar;
......
807 808
    private void readDocid(String docid, boolean result,
808 809
                           boolean expextedKarmaFailure) {
809 810
        try {
810
            Reader r = m.read(docid);
811
            Reader r = new InputStreamReader(m.read(docid));
811 812
            String response = IOUtil.getAsString(r, true);
812 813

  
813 814
            if (!result) {
......
839 840
                                         boolean result,
840 841
                                         boolean expectedKarmaFailure) {
841 842
        try {
842
            Reader r = m.read(docid);
843
            Reader r = new InputStreamReader(m.read(docid));
843 844
            String doc = IOUtil.getAsString(r, true);
844 845
            if (result) {
845 846

  
test/edu/ucsb/nceas/metacattest/BuildIndexTest.java
26 26

  
27 27
import java.io.FileReader;
28 28
import java.io.IOException;
29
import java.io.InputStreamReader;
29 30
import java.io.Reader;
30 31
import java.io.StringReader;
31 32
import java.util.Calendar;
......
150 151
			m.login(username, password);
151 152
			String response = m.insert(identifier, new StringReader(testdocument), null);
152 153
			System.err.println(response);
153
			Reader r = m.read(newdocid + ".1");
154
			Reader r = new InputStreamReader(m.read(newdocid + ".1"));
154 155
			String doc = IOUtil.getAsString(r, true);
155 156
			// doc = doc +"\n";
156 157
			System.err.println(doc);
test/edu/ucsb/nceas/metacattest/InlineDataAccessTest.java
25 25

  
26 26
package edu.ucsb.nceas.metacattest;
27 27

  
28
import java.io.InputStreamReader;
28 29
import java.io.Reader;
29 30
import java.io.StringReader;
30 31
import java.util.Calendar;
......
1892 1893
                                              boolean expextedKarmaFailure) {
1893 1894
        try {
1894 1895
        	debug("before read, docid: " + docid);
1895
            Reader r = m.readInlineData(docid);
1896
            Reader r = new InputStreamReader(m.readInlineData(docid));
1896 1897
        	debug("after read, docid: " + docid);
1897 1898
            String doc = IOUtil.getAsString(r, true);
1898 1899
        	debug("after get as string, doc: " + doc);
......
1938 1939
    private void readDocid(String docid, boolean result,
1939 1940
                           boolean expextedKarmaFailure) {
1940 1941
        try {
1941
            Reader r = m.read(docid);
1942
            Reader r = new InputStreamReader(m.read(docid));
1942 1943
            String response = IOUtil.getAsString(r, true);
1943 1944

  
1944 1945
            if (!result) {
......
1976 1977
                                         boolean result,
1977 1978
                                         boolean expextedKarmaFailure) {
1978 1979
        try {
1979
            Reader r = m.read(docid);
1980
            Reader r = new InputStreamReader(m.read(docid));
1980 1981
            String doc = IOUtil.getAsString(r, true);
1981 1982
            if (result) {
1982 1983

  
test/edu/ucsb/nceas/metacattest/client/MetacatClientTest.java
28 28
import java.io.File;
29 29
import java.io.FileReader;
30 30
import java.io.FileWriter;
31
import java.io.InputStreamReader;
31 32
import java.io.IOException;
32 33
import java.io.Reader;
33 34
import java.io.StringReader;
......
253 254
        try {
254 255
            m.login(username, password);
255 256
            String docid = readIdFromFile(DOCID);
256
            Reader r = m.read(docid+".1");
257
            Reader r = new InputStreamReader(m.read(docid+".1"));
257 258
            String doc = IOUtil.getAsString(r, true);
258 259
            doc = doc +"\n";
259 260
            if (!doc.equals(testdocument)) {
......
279 280
        try {
280 281
            m.login(anotheruser, anotherpassword);
281 282
            String docid = readIdFromFile(DOCID);
282
            Reader r = m.read(docid+".1");
283
            Reader r = new InputStreamReader(m.read(docid+".1"));
283 284
            String doc = IOUtil.getAsString(r, true);
284 285
            assertTrue(doc.indexOf("<error>") != -1);
285 286
            debug("invalidRead(): doc="+ doc);

Also available in: Unified diff