Skip to content

Commit dac1aac

Browse files
committed
fix #687 - clean up indenting in some classes we missed
(cherry picked from commit 8fe6804)
1 parent 55ac14d commit dac1aac

File tree

2 files changed

+58
-58
lines changed

2 files changed

+58
-58
lines changed

src/test/java/com/marklogic/client/test/FailedRequestTest.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,33 @@
3939
import javax.xml.stream.XMLStreamWriter;
4040

4141
public class FailedRequestTest {
42-
private static final Logger logger = LoggerFactory.getLogger(FailedRequestTest.class);
42+
private static final Logger logger = LoggerFactory.getLogger(FailedRequestTest.class);
4343

44-
@Test
45-
public void testFailedRequest()
46-
throws FailedRequestException, ForbiddenUserException, ResourceNotFoundException, ResourceNotResendableException, XMLStreamException
44+
@Test
45+
public void testFailedRequest()
46+
throws FailedRequestException, ForbiddenUserException, ResourceNotFoundException, ResourceNotResendableException, XMLStreamException
4747
{
48-
//System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.wire", "debug");
49-
Common.connectAdmin();
50-
QueryOptionsManager mgr = Common.adminClient.newServerConfigManager()
51-
.newQueryOptionsManager();
52-
53-
try {
54-
mgr.writeOptions("testempty", new StringHandle("<options xmlns=\"http://marklogic.com/appservices/search\"/>"));
55-
} catch (ForbiddenUserException e) {
56-
assertEquals(
57-
"Local message: User is not allowed to write /config/query. Server Message: You do not have permission to this method and URL.",
58-
e.getMessage());
59-
assertEquals(403, e.getFailedRequest().getStatusCode());
60-
assertEquals("Forbidden", e.getFailedRequest().getStatus());
61-
}
62-
mgr = Common.adminClient.newServerConfigManager().newQueryOptionsManager();
63-
64-
Common.adminClient.newServerConfigManager().setQueryOptionValidation(true);
65-
66-
StringWriter xml = new StringWriter();
67-
XMLStreamWriter xsw = XMLOutputFactory.newInstance().createXMLStreamWriter(xml);
68-
xsw.writeStartDocument();
48+
//System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.wire", "debug");
49+
Common.connectAdmin();
50+
QueryOptionsManager mgr = Common.adminClient.newServerConfigManager()
51+
.newQueryOptionsManager();
52+
53+
try {
54+
mgr.writeOptions("testempty", new StringHandle("<options xmlns=\"http://marklogic.com/appservices/search\"/>"));
55+
} catch (ForbiddenUserException e) {
56+
assertEquals(
57+
"Local message: User is not allowed to write /config/query. Server Message: You do not have permission to this method and URL.",
58+
e.getMessage());
59+
assertEquals(403, e.getFailedRequest().getStatusCode());
60+
assertEquals("Forbidden", e.getFailedRequest().getStatus());
61+
}
62+
mgr = Common.adminClient.newServerConfigManager().newQueryOptionsManager();
63+
64+
Common.adminClient.newServerConfigManager().setQueryOptionValidation(true);
65+
66+
StringWriter xml = new StringWriter();
67+
XMLStreamWriter xsw = XMLOutputFactory.newInstance().createXMLStreamWriter(xml);
68+
xsw.writeStartDocument();
6969
xsw.writeStartElement("options");
7070
xsw.writeDefaultNamespace("http://marklogic.com/appservices/search");
7171
xsw.writeStartElement("constraint");

src/test/java/com/marklogic/client/test/TransformTest.java

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -274,38 +274,38 @@ public void test118() {
274274
}
275275

276276
/*
277-
@Test
278-
public void testIssue471() {
279-
String transform = "xquery version '1.0-ml';" +
280-
"module namespace transform = 'http://marklogic.com/rest-api/transform/testIssue471';" +
281-
282-
"import module namespace json = 'http://marklogic.com/xdmp/json' at '/MarkLogic/json/json.xqy';" +
283-
284-
"declare namespace search = 'http://marklogic.com/appservices/search';" +
285-
286-
"declare function transform(" +
287-
" $context as map:map," +
288-
" $params as map:map," +
289-
" $content as document-node()" +
290-
") as document-node()" +
291-
"{" +
292-
" let $c := json:config('custom') ," +
293-
" $cx := map:put( $c, 'whitespace', 'ignore' )," +
294-
" $cx := map:put( $c, 'text-value', 'label' )," +
295-
" $cx := map:put( $c, 'camel-case', fn:true() )," +
296-
" $cx := map:put( $c, 'json-attributes', ('snippet-format', 'total', 'start', 'page-length'))," +
297-
" $cx := map:put( $c, 'array-element-names', (xs:QName('search:result')))" +
298-
" let $_ := map:put($context, 'output-type', 'text/json')" +
299-
" let $json := json:transform-to-json( $content ,$c )" +
300-
" return $json" +
301-
"};";
302-
extensionMgr.writeXQueryTransform( "testIssue471", new StringHandle().with(transform));
303-
QueryManager q = Common.client.newQueryManager();
304-
StringQueryDefinition s = q.newStringDefinition();
305-
s.setCriteria("a");
306-
s.setResponseTransform(new ServerTransform("testIssue471"));
307-
JacksonHandle response = q.search(s, new JacksonHandle());
308-
System.out.println(response.toString());
309-
}
277+
@Test
278+
public void testIssue471() {
279+
String transform = "xquery version '1.0-ml';" +
280+
"module namespace transform = 'http://marklogic.com/rest-api/transform/testIssue471';" +
281+
282+
"import module namespace json = 'http://marklogic.com/xdmp/json' at '/MarkLogic/json/json.xqy';" +
283+
284+
"declare namespace search = 'http://marklogic.com/appservices/search';" +
285+
286+
"declare function transform(" +
287+
" $context as map:map," +
288+
" $params as map:map," +
289+
" $content as document-node()" +
290+
") as document-node()" +
291+
"{" +
292+
" let $c := json:config('custom') ," +
293+
" $cx := map:put( $c, 'whitespace', 'ignore' )," +
294+
" $cx := map:put( $c, 'text-value', 'label' )," +
295+
" $cx := map:put( $c, 'camel-case', fn:true() )," +
296+
" $cx := map:put( $c, 'json-attributes', ('snippet-format', 'total', 'start', 'page-length'))," +
297+
" $cx := map:put( $c, 'array-element-names', (xs:QName('search:result')))" +
298+
" let $_ := map:put($context, 'output-type', 'text/json')" +
299+
" let $json := json:transform-to-json( $content ,$c )" +
300+
" return $json" +
301+
"};";
302+
extensionMgr.writeXQueryTransform( "testIssue471", new StringHandle().with(transform));
303+
QueryManager q = Common.client.newQueryManager();
304+
StringQueryDefinition s = q.newStringDefinition();
305+
s.setCriteria("a");
306+
s.setResponseTransform(new ServerTransform("testIssue471"));
307+
JacksonHandle response = q.search(s, new JacksonHandle());
308+
System.out.println(response.toString());
309+
}
310310
*/
311311
}

0 commit comments

Comments
 (0)