Package com.volantis.synergetics.testtools.io

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager


    /**
     * Test the getting of the device policy descriptors.
     */
    public void testGetRealPolicyValue() throws Exception {

        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File file) throws Exception {

                DeviceRepositoryFactory factory =
                            DeviceRepositoryFactory.getDefaultInstance();
                URL deviceRepositoryUrl = file.toURL();
View Full Code Here


* a pre-configured XML repository
*/
public class XMLRepositoryManager{

    public void executeWith(final RepositoryCommand command) throws Exception {
        TemporaryFileManager manager = new TemporaryFileManager(
                new NonExistantTemporaryFileCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File file) throws Exception {
                // set up
                Map properties = new HashMap();
                XMLRepository repository;
                RepositoryConnection repositoryConnection;
View Full Code Here

    /**
     * Tests PolicyUtils.findProblemMarkers(IResource, Element, XPath).
     */
    public void testFindProblemMarkersWithElement() throws Throwable {

        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File repository) throws Exception {
//                DeviceRepositoryAccessorManager deviceRAM =
//                        new DeviceRepositoryAccessorManager(
//                                repository.getPath(),
//                                new TestTransformerMetaFactory(),
View Full Code Here

     * @throws Exception
     */
    public void testDeviceImage() throws Exception {

        final String imageName = "tt_blackbox2.wbmp";
        TemporaryFileManager fileManager = new TemporaryFileManager(
                new ResourceTemporaryFileCreator(
                        FileImageAssetFactoryTestCase.class, imageName));

        fileManager.executeWith(new TemporaryFileExecutor() {
            public void execute(File temporaryFile) throws Exception {

                final String assetGroup = "assetgroup";
                final String deviceName = "wapdevice";
                FileImageAssetFactory factory = new FileImageAssetFactory();
View Full Code Here

     * @throws Exception
     */
    public void testGenericImage() throws Exception {

        final String imageName = "gimp.gif";
        TemporaryFileManager fileManager = new TemporaryFileManager(
                new ResourceTemporaryFileCreator(
                        FileImageAssetFactoryTestCase.class, imageName));

        fileManager.executeWith(new TemporaryFileExecutor() {
            public void execute(File temporaryFile) throws Exception {

                FileImageAssetFactory factory = new FileImageAssetFactory();
                final String assetGroup = "assetgroup";
                Variant variant = factory.createGenericImageVariant(
View Full Code Here

     * @throws Exception
     */
    public void testConvertibleImage() throws Exception {

        final String imageName = "tt_greenbrandlogo.png";
        TemporaryFileManager fileManager = new TemporaryFileManager(
                new ResourceTemporaryFileCreator(
                        FileImageAssetFactoryTestCase.class, imageName));

        fileManager.executeWith(new TemporaryFileExecutor() {
            public void execute(File temporaryFile) throws Exception {

                FileImageAssetFactory factory = new FileImageAssetFactory();
                final String assetGroup = "assetgroup";
                Variant variant = factory.createConvertibleImageVariant(
View Full Code Here

     * @throws Exception
     */
    public void testNoExtension() throws Exception {

        final String image = "image";
        TemporaryFileManager fileManager = new TemporaryFileManager(
                new ResourceTemporaryFileCreator(
                        FileImageAssetFactoryTestCase.class, image));

        fileManager.executeWith(new TemporaryFileExecutor() {
            public void execute(File temporaryFile) throws Exception {

                FileImageAssetFactory factory = new FileImageAssetFactory();
                final String assetGroup = "assetgroup";
                try {
View Full Code Here

     * @throws Exception
     */
    public void testNoEncoding() throws Exception {

        final String image = "image.unknown";
        TemporaryFileManager fileManager = new TemporaryFileManager(
                new ResourceTemporaryFileCreator(
                        FileImageAssetFactoryTestCase.class, image));

        fileManager.executeWith(new TemporaryFileExecutor() {
            public void execute(File temporaryFile) throws Exception {

                FileImageAssetFactory factory = new FileImageAssetFactory();
                final String assetGroup = "assetgroup";
                try {
View Full Code Here

     * Tests the class of the factory-created PolicyValueModifier is correct
     * for the policy name.
     */
    public void testPolicyValueModifierFactory() throws Exception {

        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File repository) throws Exception {

                DeviceRepositoryAccessorManager deviceRAM =
                        new DeviceRepositoryAccessorManager(
                                repository.getPath(),
View Full Code Here

     * Tests the private ListPolicyValueModifier#updatePolicyElement method.
     * @throws Throwable
     */
    public void testUpdatePolicyElement() throws Throwable {

        TemporaryFileManager tempFileMgr = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        tempFileMgr.executeWith(new TemporaryFileExecutor() {
            public void execute(File repository) throws Exception {

                // Create the manager from the repository file, giving it an
                // ODOMFactory,
                DeviceRepositoryAccessorManager deviceRAM =
View Full Code Here

TOP

Related Classes of com.volantis.synergetics.testtools.io.TemporaryFileManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.