Package org.rhq.core.domain.drift

Examples of org.rhq.core.domain.drift.Filter


        File indexHtml = touch(myapp, "index.html");

        File confDir = mkdir(basedir, "conf");
        File serverConf = touch(confDir, "server.conf");

        List<Filter> includes = asList(new Filter(deployDir.getAbsolutePath(), null));
        List<Filter> excludes = emptyList();
        TestVisitor visitor = new TestVisitor();

        forEachFile(basedir, new FilterFileVisitor(basedir, includes, excludes, visitor));
View Full Code Here


                List<Filter> includes = dconfig.getIncludes();

                assertNotNull(includes, "Expected to find default property set for <includes>");
                assertEquals(includes.size(), 2, "Expected <includes> property list to have two property elements.");

                Filter include1 = includes.get(0);
                String path1 = include1.getPath();
                String pattern1 = include1.getPattern();

                assertNotNull(path1, "Expected to find a simple property for the path of the first <include>");
                assertEquals(path1, "ilib", "The value is wrong for the path of the first <include>");

                assertNotNull(pattern1, "Expected to find a simple property for the pattern of the first <include>");
                assertEquals(pattern1, "*.ijar", "The value is wrong for the pattern of the first <include>");

                Filter include2 = includes.get(1);
                String path2 = include2.getPath();
                String pattern2 = include2.getPattern();

                assertNotNull(path2, "Expected to find a simple property for the path of the second <include>");
                assertEquals(path2, "iconf", "The value is wrong for the path of the second <include>");

                assertNotNull(pattern2, "Expected to find a simple property for the pattern of the second <include>");
                assertEquals(pattern2, "*.ixml", "The value is wrong for the pattern of the second <include>");
            }
        });

        verifyDriftDefinition(descriptor, "TestServer", "test2", new AssertDriftTemplateRunnable() {
            @Override
            public void assertDriftTemplate(DriftDefinitionTemplate driftTemplate) throws Exception {
                Configuration config = driftTemplate.getConfiguration();
                DriftDefinition dconfig = new DriftDefinition(config);

                assertEquals(dconfig.getInterval(), 22222L);
                assertEquals(dconfig.getBasedir().getValueContext(), BaseDirValueContext.resourceConfiguration);
                assertEquals(dconfig.getBasedir().getValueName(), "var.lib.test2");

                assertNotNull(dconfig.getIncludes(), "though we have no includes, still expect non-null empty list");
                assertEquals(dconfig.getIncludes().size(), 0);

                List<Filter> excludes = dconfig.getExcludes();

                assertNotNull(excludes, "Expected to find default property set for <excludes>");
                assertEquals(excludes.size(), 2, "Expected <excludes> property list to have two property elements.");

                Filter exclude1 = excludes.get(0);
                String path1 = exclude1.getPath();
                String pattern1 = exclude1.getPattern();

                assertNotNull(path1, "Expected to find a simple property for the path of the first <exclude>");
                assertEquals(path1, "elib", "The value is wrong for the path of the first <exclude>");

                assertNotNull(pattern1, "Expected to find a simple property for the pattern of the first <exclude>");
                assertEquals(pattern1, "*.ejar", "The value is wrong for the pattern of the first <exclude>");

                Filter exclude2 = excludes.get(1);
                String path2 = exclude2.getPath();
                String pattern2 = exclude2.getPattern();

                assertNotNull(path2, "Expected to find a simple property for the path of the second <exclude>");
                assertEquals(path2, "econf", "The value is wrong for the path of the second <exclude>");

                assertNotNull(pattern2, "Expected to find a simple property for the pattern of the second <exclude>");
                assertEquals(pattern2, "*.exml", "The value is wrong for the pattern of the second <exclude>");
            }
        });

        verifyDriftDefinition(descriptor, "TestServer", "test3", new AssertDriftTemplateRunnable() {
            @Override
            public void assertDriftTemplate(DriftDefinitionTemplate driftTemplate) throws Exception {
                Configuration config = driftTemplate.getConfiguration();
                DriftDefinition dconfig = new DriftDefinition(config);

                assertEquals(dconfig.getInterval(), 33333L);
                assertEquals(dconfig.getBasedir().getValueContext(), BaseDirValueContext.measurementTrait);
                assertEquals(dconfig.getBasedir().getValueName(), "var.lib.test3");

                List<Filter> includes = dconfig.getIncludes();

                assertNotNull(includes, "Expected to find default property set for <includes>");
                assertEquals(includes.size(), 2, "Expected <includes> property list to have two property elements.");

                Filter include1 = includes.get(0);
                String path1 = include1.getPath();
                String pattern1 = include1.getPattern();

                assertNotNull(path1, "Expected to find a simple property for the path of the first <include>");
                assertEquals(path1, "ilib", "The value is wrong for the path of the first <include>");

                assertNotNull(pattern1, "Expected to find a simple property for the pattern of the first <include>");
                assertEquals(pattern1, "*.ijar", "The value is wrong for the pattern of the first <include>");

                Filter include2 = includes.get(1);
                String path2 = include2.getPath();
                String pattern2 = include2.getPattern();

                assertNotNull(path2, "Expected to find a simple property for the path of the second <include>");
                assertEquals(path2, "iconf", "The value is wrong for the path of the second <include>");

                assertNotNull(pattern2, "Expected to find a simple property for the pattern of the second <include>");
                assertEquals(pattern2, "*.ixml", "The value is wrong for the pattern of the second <include>");

                List<Filter> excludes = dconfig.getExcludes();

                assertNotNull(excludes, "Expected to find default property set for <excludes>");
                assertEquals(excludes.size(), 2, "Expected <excludes> property list to have two property elements.");

                Filter exclude1 = excludes.get(0);
                path1 = exclude1.getPath();
                pattern1 = exclude1.getPattern();

                assertNotNull(path1, "Expected to find a simple property for the path of the first <exclude>");
                assertEquals(path1, "elib", "The value is wrong for the path of the first <exclude>");

                assertNotNull(pattern1, "Expected to find a simple property for the pattern of the first <exclude>");
                assertEquals(pattern1, "*.ejar", "The value is wrong for the pattern of the first <exclude>");

                Filter exclude2 = excludes.get(1);
                path2 = exclude2.getPath();
                pattern2 = exclude2.getPattern();

                assertNotNull(path2, "Expected to find a simple property for the path of the second <exclude>");
                assertEquals(path2, "econf", "The value is wrong for the path of the second <exclude>");

                assertNotNull(pattern2, "Expected to find a simple property for the pattern of the second <exclude>");
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.drift.Filter

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.