edgent-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlaboss <...@git.apache.org>
Subject [GitHub] incubator-quarks pull request: [QUARKS-181] Add globalization test...
Date Thu, 26 May 2016 20:16:29 GMT
Github user dlaboss commented on a diff in the pull request:

    https://github.com/apache/incubator-quarks/pull/123#discussion_r64813201
  
    --- Diff: connectors/file/src/test/java/quarks/test/connectors/file/FileStreamsGlobalTest.java
---
    @@ -0,0 +1,48 @@
    +/*
    +Licensed to the Apache Software Foundation (ASF) under one
    +or more contributor license agreements.  See the NOTICE file
    +distributed with this work for additional information
    +regarding copyright ownership.  The ASF licenses this file
    +to you under the Apache License, Version 2.0 (the
    +"License"); you may not use this file except in compliance
    +with the License.  You may obtain a copy of the License at
    +
    +  http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing,
    +software distributed under the License is distributed on an
    +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +KIND, either express or implied.  See the License for the
    +specific language governing permissions and limitations
    +under the License.
    +*/
    +package quarks.test.connectors.file;
    +
    +import org.junit.Test;
    +
    +/**
    + * FileStreams connector globalization tests.
    + */
    +public class FileStreamsGlobalTest extends FileStreamsTest {
    +
    +    String[] globalLines = new String[] {
    +            "學而時習之",
    +            "不亦說乎"
    +    };
    +
    +    @Test
    +    public void testGlobalTextFileReader() throws Exception {
    --- End diff --
    
    The global strings are nicely isolated and the test code is nicely reused.  However needing
to override all of the methods of the base/standard class seems unfortunate.  Can that be
avoided / simplified by something along the lines of the following?
    ```
    String[] stdLines = new String[] {  // keep the original code
      ...
    }
    
    public String[] getLines() { return stdLines; }  // override in the global test
    
    public void testFoo() {  // orig signature
        // orig code String[] lines = stdLines;
        String[] lines = getLines();  // new code
        ... // rest of orig code
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message