Package org.exolab.castor.mapping

Examples of org.exolab.castor.mapping.Mapping


        String registryFile = "../test/conf/test-registry.xreg";
       
        File map = new File(mapFile);
        try
        {
            Mapping mapping = new Mapping();
            InputSource is = new InputSource(new FileReader(map));
            is.setSystemId(mapFile);
            mapping.loadMapping(is);
           
            DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dbfactory.newDocumentBuilder();
      
            Document d = builder.parse(new File(registryFile));
View Full Code Here


    {
        System.out.println("Testing marshalling of PSML on base *** ConfigElement ***");

        String psmlFile = "../webapp/WEB-INF/psml/test/testcase.psml";

        Mapping mapping = null;
        String mapFile = getMappingFileName();
        File map = new File(mapFile);
        if (map.exists() && map.isFile() && map.canRead())
        {
            try
            {
                FileReader reader = new FileReader(psmlFile);
                mapping = new Mapping();
                InputSource is = new InputSource( new FileReader(map) );
                is.setSystemId( mapFile );
                mapping.loadMapping( is );
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                ConfigElement rootset = (ConfigElement)unmarshaller.unmarshal(reader);
               
                assertTrue(rootset.getName().equals("theRootSet"));

View Full Code Here

    {
        System.out.println("Testing marshalling of PSML on base *** IdentityElement ***");

        String psmlFile = "../webapp/WEB-INF/psml/test/testcase.psml";

        Mapping mapping = null;
        String mapFile = getMappingFileName();
        File map = new File(mapFile);
        if (map.exists() && map.isFile() && map.canRead())
        {
            try
            {
                FileReader reader = new FileReader(psmlFile);
                mapping = new Mapping();
                InputSource is = new InputSource( new FileReader(map) );
                is.setSystemId( mapFile );
                mapping.loadMapping( is );
                System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                Portlets rootset = (Portlets)unmarshaller.unmarshal(reader);
                System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");

View Full Code Here

    {
        System.out.println("Testing marshalling of PSML on base *** Security ***");

        String psmlFile = "../webapp/WEB-INF/psml/test/testsecurity.psml";

        Mapping mapping = null;
        String mapFile = getMappingFileName();
        File map = new File(mapFile);
        if (map.exists() && map.isFile() && map.canRead())
        {
            try
            {
                FileReader reader = new FileReader(psmlFile);
                mapping = new Mapping();
                InputSource is = new InputSource( new FileReader(map) );
                is.setSystemId( mapFile );
                mapping.loadMapping( is );
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                Security security = (Security)unmarshaller.unmarshal(reader);
                assertNotNull(security);
                assertTrue(security.getId().equals("1000"));

View Full Code Here

    {
        System.out.println("Testing marshalling of PSML on base *** Security-ref ***");

        String psmlFile = "../webapp/WEB-INF/psml/test/testcase_securityref.psml";

        Mapping mapping = null;
        String mapFile = getMappingFileName();
        File map = new File(mapFile);
        if (map.exists() && map.isFile() && map.canRead())
        {
            FileReader reader = new FileReader(psmlFile);
            mapping = new Mapping();
            InputSource is = new InputSource( new FileReader(map) );
            is.setSystemId( mapFile );
            mapping.loadMapping( is );

            System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
            Unmarshaller unmarshaller = new Unmarshaller(mapping);
            Portlets rootset = (Portlets)unmarshaller.unmarshal(reader);
            System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
View Full Code Here

    {
        System.out.println("Testing marshalling of PSML on base *** IdentityElement ***");

        String psmlFile = "../webapp/WEB-INF/psml/test/testcaseMarshall.psml";

        Mapping mapping = null;
        String mapFile = getMappingFileName();
        File map = new File(mapFile);
        if (map.exists() && map.isFile() && map.canRead())
        {
            try
            {
                FileReader reader = new FileReader(psmlFile);
                mapping = new Mapping();
                InputSource is = new InputSource( new FileReader(map) );
                is.setSystemId( mapFile );
                mapping.loadMapping( is );
                System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                Portlets rootset = (Portlets)unmarshaller.unmarshal(reader);
                System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");

View Full Code Here

       
        System.out.println("Testing marshalling of PSML on base *** IdentityElement ***");

        String psmlFile = "../webapp/WEB-INF/psml/test/testcaseMarshall.psml";

        Mapping mapping = null;
        String mapFile = getMappingFileName();
        File map = new File(mapFile);
        if (map.exists() && map.isFile() && map.canRead())
        {
            try
            {
                FileReader reader = new FileReader(psmlFile);
                mapping = new Mapping();
                InputSource is = new InputSource( new FileReader(map) );
                is.setSystemId( mapFile );
                mapping.loadMapping( is );
                System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                Portlets rootset = (Portlets)unmarshaller.unmarshal(reader);
                System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");

View Full Code Here

    {
        System.out.println("Testing marshalling of Registry");

        String xregFile = "../webapp/WEB-INF/psml/test/testcase-2.xreg";

        Mapping mapping = null;
        String mapFile = getMappingFileName();
        File map = new File(mapFile);
        if (map.exists() && map.isFile() && map.canRead())
        {
            try
            {
                FileReader reader = new FileReader(xregFile);
                mapping = new Mapping();
                InputSource is = new InputSource(new FileReader(map));
                is.setSystemId(mapFile);
                mapping.loadMapping(is);
                Unmarshaller unmarshaller = new Unmarshaller(mapping);
                RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal(reader);
                assertNotNull(fragment);
                Vector portlets = fragment.getPortlets();
View Full Code Here

        boolean entryFound = false;
        System.out.println("Testing marshalling of Registry security-entry");

        String xregFile = "../webapp/WEB-INF/psml/test/testcase-security.xreg";

        Mapping mapping = null;
        String mapFile = getMappingFileName();
        File map = new File(mapFile);
        if (map.exists() && map.isFile() && map.canRead())
        {
            FileReader reader = new FileReader(xregFile);
            mapping = new Mapping();
            InputSource is = new InputSource(new FileReader(map));
            is.setSystemId(mapFile);
            mapping.loadMapping(is);
            Unmarshaller unmarshaller = new Unmarshaller(mapping);
            RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal(reader);
            assertNotNull(fragment);
            Vector securityEntries = fragment.getSecurityEntries();
            assertTrue("Security Entries exist", !securityEntries.isEmpty());
View Full Code Here

    {
        System.out.println("Testing marshalling of Registry security-ref");

        String xregFile = "../webapp/WEB-INF/psml/test/testcase-security.xreg";

        Mapping mapping = null;
        String mapFile = getMappingFileName();
        File map = new File(mapFile);
        if (map.exists() && map.isFile() && map.canRead())
        {
            FileReader reader = new FileReader(xregFile);
            mapping = new Mapping();
            InputSource is = new InputSource(new FileReader(map));
            is.setSystemId(mapFile);
            mapping.loadMapping(is);
            Unmarshaller unmarshaller = new Unmarshaller(mapping);
            RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal(reader);
            assertNotNull(fragment);
            Vector securityEntries = fragment.getSecurityEntries();
            assertTrue("Security Entries exist", !securityEntries.isEmpty());
View Full Code Here

TOP

Related Classes of org.exolab.castor.mapping.Mapping

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.