/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
@bug 5089429 6982632
@summary Checks that we don't crash if rendering operations and state
changes are performed on a graphics context from different threads.
@author Dmitri.Trembovetski@sun.com area=Graphics
@run main MTGraphicsAccessTest
*/
public class MTGraphicsAccessTest {
// in seconds
static boolean standaloneMode;
static boolean allowExceptions = true;
static long testRunTime;
volatile boolean done;
volatile int stillRunning;
volatile int numexceptions;
};
};
null,
};
new BasicStroke(),
new BasicStroke(0.0f),
new BasicStroke(2.0f),
new float[]{0,6,0,6}, 0),
};
new AffineTransform(),
};
public MTGraphicsAccessTest() {
done = false;
numexceptions = 0;
}
}
done = true;
if (numexceptions == 0) {
} else if (!allowExceptions) {
throw new RuntimeException("Test failed with "+
numexceptions+" exceptions");
} else {
numexceptions+" exceptions");
}
}
try {
// add +/-5ms variance to increase randomness
} catch (InterruptedException e) {};
}
}
"(default: limited number of tests is run)");
STANDALONE_RUN_TIME+"s for the full suite)");
}
boolean testRunSet = false;
standaloneMode = true;
allowExceptions = false;
try {
} else {
}
testRunSet = true;
} catch (NumberFormatException e) {
} catch (ArrayIndexOutOfBoundsException e1) {
usage("Missing the 'seconds' argument for -time parameter");
}
} else {
}
}
if (!testRunSet) {
testRunTime = 1000 *
}
new MTGraphicsAccessTest();
}
stillRunning++;
this.testRunnable = testRunnable;
}
public void run() {
try {
while (!done) {
try {
testRunnable.run();
yield();
} catch (Throwable t) {
t.printStackTrace();
}
}
} finally {
stillRunning--;
}
}
}
new Runnable() {
public void run() {
mysleep(10);
}
},
new Runnable() {
public void run() {
mysleep(10);
}
},
new Runnable() {
int c = 0;
public void run() {
mysleep(10);
}
},
new Runnable() {
boolean AA = false;
public void run() {
if (AA) {
} else {
}
mysleep(10);
}
},
new Runnable() {
int t = 0;
public void run() {
mysleep(10);
}
},
new Runnable() {
int c = 0;
public void run() {
} else {
}
mysleep(10);
}
},
new Runnable() {
int s = 0;
public void run() {
mysleep(10);
}
},
new Runnable() {
int f = 0;
public void run() {
mysleep(10);
}
},
};
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
// REMIND: copyArea doesn't work when transform is set..
// new Runnable() {
// public void run() {
// sharedGraphics.copyArea(10, 10, 30, 30, 20, 20);
// }
// },
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
},
new Runnable() {
public void run() {
}
}
};
}