Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 1&1 Internet AG, https://github.com/1and1/ Licensed 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 net.oneandone.jasmin.model;
 
 import org.junit.Test;
 
     private static final World WORLD = new World();
     private References reference;
 
     @Test
     public void cssEmpty() throws Exception {
         css("");
     }
 
     @Test
     public void cssShort() throws Exception {
         css("abc {}");
     }
 
     @Test
     public void cssLong() throws Exception {
         css("abc { foo: a01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789 }");
     }
 
     @Test
     public void jsEmpty() throws Exception {
         js("");
     }
 
     @Test
     public void jsShort() throws Exception {
         js("");
         js("abc = 0;");
     }
 
     @Test
     public void jsLong() throws Exception {
         js("foo=\"01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
                 + "01234567890123456789012345678901234567890123456789012345678901234567890123456789\"\n");
     }
 
     private void js(String strthrows Exception {
         check(.falsestr);
         check(.truestr);
     }
 
     private void css(String strthrows Exception {
         check(.falsestr);
         check(.truestr);
     }
 
     private void check(MimeType typeboolean minimizeString strthrows Exception {
         doCheck(typeminimize.getTemp().createTempFile(), str);
         doCheck(typeminimize.node("dav://localhost/webdav/foo.txt"), str);
     }
 
     private void doCheck(MimeType typeboolean minimizeNode nodeString strthrows Exception {
         node.writeString(str);
          = References.create(typeminimizenode);
         parallel(5, 369, .readBytes());
        node.deleteFile();
    }
    private void parallel(int countint repeatbyte[] expectedthrows Exception {
        ReadThread[] threads;
        threads = new ReadThread[count];
        for (int i = 0; i < threads.lengthi++) {
            threads[i] = new ReadThread(expectedrepeat);
            threads[i].start();
        }
        for (ReadThread thread : threads) {
            thread.finish();
        }
    }
New to GrepCode? Check out our FAQ X