Package org.apache.cayenne.project

Examples of org.apache.cayenne.project.DataNodeConfigInfo


                    + info.getAltProjectFile());
        }

        Iterator nodes = info.getNodes().iterator();
        while (nodes.hasNext()) {
            DataNodeConfigInfo node = (DataNodeConfigInfo) nodes.next();
            if (node.getName() == null) {
                throw new BuildException("'node.name' attribute is required.");
            }

            if (node.getDataSource() != null && node.getDriverFile() != null) {
                throw new BuildException(
                        "'node.dataSource' and 'node.driverFile' are mutually exclusive.");
            }

            if (node.getDriverFile() != null && !node.getDriverFile().isFile()) {
                throw new BuildException("'node.driverFile' does not exist.");
            }
        }
    }
View Full Code Here


                    + info.getAltProjectFile());
        }

        Iterator nodes = info.getNodes().iterator();
        while (nodes.hasNext()) {
            DataNodeConfigInfo node = (DataNodeConfigInfo) nodes.next();
            if (node.getName() == null) {
                throw new BuildException("'node.name' attribute is required.");
            }

            if (node.getDataSource() != null && node.getDriverFile() != null) {
                throw new BuildException(
                        "'node.dataSource' and 'node.driverFile' are mutually exclusive.");
            }

            if (node.getDriverFile() != null && !node.getDriverFile().isFile()) {
                throw new BuildException("'node.driverFile' does not exist.");
            }
        }
    }
View Full Code Here

        assertTrue(newRoot.isFile());
        assertEquals(altFile.length(), newRoot.length());
    }

    public void testAltNode() throws Exception {
        DataNodeConfigInfo node = new DataNodeConfigInfo();
        node.setName("node1");
        node.setAdapter("non-existent-adapter");

        task.addNode(node);

        // run task
        task.execute();

        // check results
        assertTrue(dest.isFile());

        ZipUtil.unzip(dest, project.getBaseDir());
        File newRoot = new File(project.getBaseDir(), Configuration.DEFAULT_DOMAIN_FILE);

        String fileContents = Util.stringFromFile(newRoot);
        assertTrue(fileContents.contains(node.getName()));
        assertTrue(fileContents.contains(node.getAdapter()));
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.project.DataNodeConfigInfo

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.